orderid with point of sale application
I need help with a problem with transactions id.
table: restaurant
id, restaurant, orderid,....
table: orders
id, orderid, total,....
I need to select the orderid from restaurant and place it in the table "orders" and then orderid+1 i the table restaurant.
Example:
Someone ordered a burger and i select a new orderid for the transaction from the the table "restaurant" and place the orderid in the table "orders" after that i need to update the new value in table "restaurant" so the next order will be ok.
The problem is if we have multiple users that make transactions and one order is fast or different speed so they will take the same orderid. How can i prevent that?
Today i use:
select orderid from restaurant;
update orders set orderid=orderid+1;
Can i make it in the same sql or look rows or something?
Best regards.
Edited 1 time(s). Last edit at 04/19/2006 04:05PM by Christian Johansson.
Subject
Views
Written By
Posted
orderid with point of sale application
2883
April 19, 2006 04:04PM
1939
April 19, 2006 04:12PM
1702
April 23, 2006 04:27PM
1665
April 24, 2006 11:51AM
1742
April 25, 2006 04:24AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.