• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Generate Transaction/Sales ID by SerialNo + CustomerID + Sales Person ID + Date

 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know if this is the right group to ask in.
I'd like to generate transation ids based on a serial number, a customer id, a sales person id and the date and time
where should I store this serial number, and also can the mariaDB system automatically generate this id when a new record is created
Let me know
Thanks a lot
Jack
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are in the right forum. I'm not clear if you want to generate the value based on the other fields or a unique value. Either way, most databases support both.
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky wrote:You are in the right forum. I'm not clear if you want to generate the value based on the other fields or a unique value. Either way, most databases support both.


Should I use a stored procedure, that when a transaction is created, the transaction id column is automatically populated?
Thanks
Jack
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends on what you want to do. You likely don't need a stored procedure though.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic