insert and select in one statement

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Khurram Rao

    insert and select in one statement

    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
  • sybrandb@yahoo.com

    #2
    Re: insert and select in one statement

    khurramanis@hot mail.com (Khurram Rao) wrote in message news:<5b60a892. 0311102140.3476 256f@posting.go ogle.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

    Comment

    Working...