RE: AW: Constraint violation in spite of trigger with sequence

  • From: "Mark W. Farnham" <mwf@xxxxxxxx>
  • To: <stiebing@xxxxxxxxxxxxxxx>, "'Jay'" <jaykash@xxxxxxxxxxx>, "'chet justice'" <chet.justice@xxxxxxxxx>, <toon.koppelaars@xxxxxxxxxxx>
  • Date: Tue, 2 Feb 2010 12:44:05 -0500

Does anything else happen to :new.num after it has been selected from the
sequence in the bits of the trigger you have omitted?


Plus, did you answer the question from Toon yet? You should only be creating
the sequence once, in a quiet period. (Or as a repair, I suppose, but not as
part of the insert process each time).

-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx]
On Behalf Of A. Stiebing
Sent: Tuesday, February 02, 2010 11:14 AM
To: 'Jay'; 'chet justice'; toon.koppelaars@xxxxxxxxxxx
<snip>
> I assume you are showing us the 'select max(...' + the 'create 
> sequence' command because you have done that once.
> Or are you doing this inside some process, *every time*?
>
> In the latter case. It could very well be that between the 'select 
> max' and the 'get nextval' some other session had been adding a row to 
> that table, with a value that now also is generated by the sequence.

<snip>


--
//www.freelists.org/webpage/oracle-l


Other related posts: