tags:

views:

40

answers:

1

I want to retrieve the id of a newly inserted record with an auto incrementing id column (using the sequence and trigger method). What is the standard way to do this?

+5  A: 

Use the RETURNING clause:

insert into mytable (...) values (...)
returning id into v_id;
Tony Andrews