Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Catching Surrogate Key Value...
What is the best method for catching the value of a surrogate key (auto
increment numeric ID) when creating a 'parent' row in one table and 'child'
rows in another table?
I need to know the value of the surrogate key in the 'parent' row to populate the foreign key in the 'child' rows.
E.g.
I have entered some details on screen detailing a new contact organisation and a few contacts within that organisation. I hit 'Save' to populate the database with this information.
The parent ORGANISATIONS row is created with an internally created numeric ID.
I next need to create the CONTACTS rows. How do I get the ORGANISATIONS.ID value to put into the foreign key ORG_ID column? What is the best method?
Thank you in advance...
Nick Received on Mon May 20 2002 - 05:58:29 CDT
![]() |
![]() |