From: sybrandb@yahoo.com
Newsgroups: comp.databases.oracle
Subject: Re: insert and select in one statement
Date: 11 Nov 2003 03:52:52 -0800
Organization: http://groups.google.com
Lines: 22
Message-ID: <a1d154f4.0311110352.4f5e2ca3@posting.google.com>
References: <5b60a892.0311102140.3476256f@posting.google.com>
NNTP-Posting-Host: 145.13.42.4
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1068551573 27440 127.0.0.1 (11 Nov 2003 11:52:53 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 11 Nov 2003 11:52:53 +0000 (UTC)


khurramanis@hotmail.com (Khurram Rao) wrote in message news:<5b60a892.0311102140.3476256f@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
> @@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

