|
-
I'm not sure I'm following the question, but I do have a comment on the approach. The problem with a trigger-based incrementation strategy is that it is not multi-user capable. For example, I insert a record into the table. The trigger does a query to get the highest ID in the table, which may be 5. It adds 1 and inserts my record with an ID of 6.
*At the same time*, another user inserts a record into the table, the same trigger does the same SELECT. Since I have not yet commited my INSERT, this second user does not yet see my record and therefore also has the trigger return a value of 6. This is a bad thing. This is why sequences are the preferred solution to this problem.
- Chris
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|