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: Trigger/sequence bug in 8.1.7.2.0 and 9.0.1.3.0 and ... ?

Re: Trigger/sequence bug in 8.1.7.2.0 and 9.0.1.3.0 and ... ?

From: Jaap W. van Dijk <j.w.vandijk.removethis_at_hetnet.nl>
Date: Thu, 30 May 2002 20:35:00 GMT
Message-ID: <3cf68a24.1593354@news.jaapwvandijk.myweb.nl>


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

Original text of this message

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