Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: sequence concurrency question

Re: sequence concurrency question

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Fri, 05 May 2006 20:05:46 +0200
Message-ID: <vs4n52pmdu71ff8lj16vhoutl8ee5stplj@4ax.com>


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 DBA
Received on Fri May 05 2006 - 13:05:46 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US