Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How do you return a generated SEQUENCE?
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
![]() |
![]() |