Sequence get the last value (or store the .NEXTVAL anywhere)
522025Jul 12 2006 — edited Aug 23 2006Hi there,
I created some tables and one table references the other (foreign key).
Now I want to add some test data and insert rows to both tables.
My problem is:
The "insert into command" for table a uses a sequence value to create the primary key. Now I need the assigned primary key in my second insert command to assign the right value to the foreign key.
Is there a way to get the last assigned value from a sequence? Or can I store the key to some sort of variable and use this in both statements?
Thx a lot
Dominik