General information
Category:
Coding, syntax & commands
>Hi everybody,
>
>AFAIK there is no way in multi-user environment to have ID field incremented correctly without using extra table to keep the last ID (if we're not using autoincrement field). Using go bottom, grab the last number and start from there doesn't prevent two users from taking the same ID. Even if we put a check right after for the existance of ID.
>
>What do you think? Given only one table and no auto-increment is it possible to correctly auto-increment in multi-user environment?
>
>Thanks.
RLOCK(0) with a GET MAX(ID)+1 over an indexed ID is the solution.
It is equal to the extra table solution
( the index is the surrogate of the extra table )
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only