Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Catching Surrogate Key Value...

Catching Surrogate Key Value...

From: Nick P <nick_pope_at_nospamhotmail.com>
Date: Mon, 20 May 2002 11:58:29 +0100
Message-ID: <uehll0ho3nu616@corp.supernews.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US