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 )
i would create a stored procedure in which a declare a variable, lets say vID and then assign it the value of table1_sequence.nextval. Then use the value of vID in your insert statement.
If you don't use the vID value besides the insert, you can also use the table1_sequence.nextval directly in your sql statement:
If you get the table1_sequence after the insert, you are not sure if it's the correct value, because another insert can already have been done.