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

Home -> Community -> Usenet -> c.d.o.misc -> Re: How do you return a generated SEQUENCE?

Re: How do you return a generated SEQUENCE?

From: Dan Clamage <clamage_at_mime.dw.lucent.com>
Date: 1997/11/05
Message-ID: <01bce9bf$3481d300$54110b87@clamagent>#1/1

I don't know how a trigger is going to return anything to a client. What I've done is write a stored procedure to do the INSERT (instead of/in addition to a trigger) and generate the sequence_object.NEXTVAL inside the VALUES clause. Then SELECT sequence_object.CURRVAL INTO some_var FROM DUAL; The procedure can then return some_var on the stack. The CURRVAL has to be obtained as part of the transaction, before the COMMIT. -djc
Neal Hill <nhill_at_exchange.ml.com> wrote in article <345fd811.547208213_at_news>...
> Hello, we have a problem that perhaps someone else has come across and
> solved:
> We have an insert trigger that is setting a field with a generated
> sequence number. We need to know what that generated sequence number
> was after the trigger finished updating the field, so that the client
> may keep that as a key.
Received on Wed Nov 05 1997 - 00:00:00 CST

Original text of this message

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