Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Trigger/sequence bug in 8.1.7.2.0 and 9.0.1.3.0 and ... ?
On Thu, 30 May 2002 00:17:06 +0200, "Sybrand Bakker"
<postbus_at_sybrandb.demon.nl> wrote:
>SQL> insert into x values(s.nextval);
>===========================================
>the value of :new.id is [1]
>selecting the nextval into a local
>variable
>done selecting the nextval into a local
>variable
>the value of :new.id is now [2]
<snip>
>
>So, is the *final* result, the record in the table *ever* incorrect. I don't
>think so.
>So a bug? I doubt it. You could debate about that, as the result *is*
>correct.
>Oracle PE 8.1.7.0.0
>
The original posting doesn't state that the value in table x is incorrect, but the value in the table x_hist, filled by the trigger on table x.
The original question was: why does the value of :new.id change when you reference nextval (from 1 to 2, see above)? When you insert a record with a value 1 for column id in table x, in a trigger on table x :new.id should be, and stay, the value of id in the inserted record, and not change from 1 to 2.
Jaap. Received on Thu May 30 2002 - 15:35:00 CDT
![]() |
![]() |