Re: insert and select in one statement
Date: 11 Nov 2003 03:52:52 -0800
Message-ID: <a1d154f4.0311110352.4f5e2ca3_at_posting.google.com>
khurramanis_at_hotmail.com (Khurram Rao) wrote in message news:<5b60a892.0311102140.3476256f_at_posting.google.com>...
> using MS Sql server and VB i can execute two queries Insert and select
> in one statement e.g. (insert into (....) values (...) Select
> _at__at_Identity).
> how can i do the same thing using Oracle and VB. ???
> It gives error. here's what i want to do.
> (insert into table1 (...) values (...) Select table1_sequence.currval
> from dual )
>
> Khurram
insert into table
select .... from dual;
And also you shouldn't use currval, but nextval
and lookup mere syntax questions in the sql reference manual at
http://tahiti.oracle.com.
Yes, I am very well aware people exposed to sqlserver NEVER read
manuals.
Sybrand Bakker
Senior Oracle DBA
Received on Tue Nov 11 2003 - 12:52:52 CET