Re: HELP: Sequence Problem!!!

From: Huwski <no email>
Date: Fri, 31 Jul 1998 08:34:09 GMT
Message-ID: <35c18014.4933504_at_news.geccs.gecm.com>


On Fri, 31 Jul 1998 09:30:22 +0200, Dirk Osenberg <d.osenberg_at_rula.com> wrote:

>This is a multi-part message in MIME format.
>--------------AE7FD436C9571CA8EFC5257B
>Content-Type: text/plain; charset=iso-8859-1
>Content-Transfer-Encoding: 8bit
>
>Hi,
>
>i have a problem: How is it possible to get the actual value of a
>sequence?
>I have the following SQL - String:
>
>strSQL = "INSERT INTO table1 (firstID,secondID) VALUES
>(SEQ1.NextVal,?????????)"
>
>I want to set in the column "secondID" the same value as in the column
>"firstID". I need a quick answer!!!
>

IF you are the only user of the sequence then try

INSERT INTO table1( firstID,secondID ) VALUES [Quoted] ( SEQ1.NextVal, SEQ1.CurrVal );

Alternatively declare a local variable

lid Number;

Begin

   Select seq.nextval
    Into l_id
    From dual;
   Inserst into table1 ( ,,,) values ( l_id,l_id ); End;

Huwski Received on Fri Jul 31 1998 - 10:34:09 CEST

Original text of this message