Re: How to (MyVariable := MySequence.currval)

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: 2000/06/28
Message-ID: <962199541.14555.0.pluto.d4ee154e_at_news.demon.nl>#1/1


select MySequence.currval
into MyVariable;

Hth,

Sybrand Bakker, Oracle DBA

"Greg" <actiris_at_loxinfo.co.th> wrote in message news:395981F0.71B072D9_at_loxinfo.co.th...
> Need to save the current value of a sequence in a variable to use it
> later.
>
> declare
> MyVariable number;
>
> MyVariable := MySequence.currval;
>
> does not work
>
> PLS-00357: Table,View Or Sequence reference 'BGV.SEQ_NAME_ID.CURRVAL'
> not allowed in this context
> ============
> The help on PLS-00357
> PLS-00357 Table,View Or Sequence reference 'string' not allowed in this
> context
> Cause: A reference to database table, view, or sequence was found in an
> inappropriate context. Such references can appear only in SQL statements
> or (excluding sequences)
> in %TYPE and %ROWTYPE declarations. Some valid examples follow:
> ============
>
> I guess the declare is wrong.....
> How to do that
> Thanks Greg
>
Received on Wed Jun 28 2000 - 00:00:00 CEST

Original text of this message