Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Sqlplus Question
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