Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: sequence concurrency question
On 5 May 2006 09:49:22 -0700, amit.varde_at_gmail.com wrote:
>tran_id is being populated using a sequence number.
>The prnt_id col is supposed to contain a 0 for the parent record
>and the tran_id for the children records
so resolve this using a before insert for each row trigger on the table instead of the code you presented which is doomed to fail. There is no guarantee the sequence is not incremented between your two accesses of it.
-- Sybrand Bakker, Senior Oracle DBAReceived on Fri May 05 2006 - 13:05:46 CDT