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 to: retrieve Sequence.NEXTVAL to a variable?

Re: How to: retrieve Sequence.NEXTVAL to a variable?

From: John Strange <jstrange_at_imtn.dsccc.com>
Date: 13 Nov 1998 12:40:31 GMT
Message-ID: <72h9bv$dnn$1@relay1.dsccc.com>


Try

    select MySequence.nextVal into MyVar FROM DUAL ;

Hugh Pendry (hpendry_at_trinitech.co.uk) wrote:
: Does anyone know how to retrieve the next value (or current value) a
: sequence into a variable in a stored procedure. I have tried various things
: including:-

: function x
: (
: ...
: )
: return ...
: is
: MyVar integer
: begin
: select MySequence.nextVal into MyVar;
: ...
: end;

: But have had no luck getting anything to work.

: Thanks in advance
: hugh.

--
While Alcatel may claim ownership of all my ideas (on or off the job), Alcatel does not claim any responsibility for them. Warranty expired when u opened this article and I will not be responsible for its contents or use. Received on Fri Nov 13 1998 - 06:40:31 CST

Original text of this message

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