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

Home -> Community -> Usenet -> c.d.o.server -> Re: Sqlplus Question

Re: Sqlplus Question

From: Pavel Polcar <pavel.polcar_at_berit.cz>
Date: 17 Jun 1998 11:52:53 GMT
Message-ID: <01bd99e6$763e15b0$47c3657e@polcar_nt4006>


Hi,
you don't have to use a variable at all. Just use <sequence_name>.currval in subsequent references to the last fetched nextval. Example:
select seq1.nextval from dual;
update xxx set a=seq1.currval;
commit;
This approach, however, has some restrictions. See SQL Reference, Pseudocolumns.

HtH,
--
Pavel Polcar

Phill Weiss <weiss_at_cig.mot.com> wrote in article <6m68j2$1ij$2_at_trotsky.cig.mot.com>...
>
>
> Is it possible to make a sqlplus query for the nextval of a sequence in
one
> query, store the result in a variable, and use the variable in a
subsequent
> sqlplus query? I don't want to have to use pl/sql to do this, only
sqlplus.
> If this is possible, please enlighten me as to how I can go about it.
Thanks.
>
>
>
>
Received on Wed Jun 17 1998 - 06:52:53 CDT

Original text of this message

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