How to get the sequence number after INSERT?

  • Thread starter Thread starter Mathias
  • Start date Start date
M

Mathias

Hi,

I have an ORACLE DB with a table, a sequence and a trigger which
starts the
sequence a new record is inserted in the table.
How do I get the sequence number of this row after I inserted this
row? I
use an ADO connection with AddNew and Update.

Thanks in advance, Mathias

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
 
Hi Mathias,

You might try something like (returning clause is the key here):
INSERT INTO <table_name>
(column_list)
VALUES
(values_list)
RETURNING <value_name>
INTO <variable_name>;

I didn't try it though.
 
Back
Top