Hamid Alavi wrote:
> 
> List,
> 
> I have some problem with Trigger, I want to Insert a record as Primary Key
> on each insert into Table1 and the same time create another Primary key in
> table2 plus PK from Tabl1 inserting in Table2 as Forign Key, Is there any
> way to do all these steps in one trigger and assign this trigger to table1
> or some thing like this or not?
> THanks Alot
> 
> Hamid Alavi
> Office 818 737-0526
> Cell    818 402-1987
>

Convoluted logic. Use a sequence as the key for table1 and refer to
seq.currval inside the trigger to insert the FK into table2. Do not try
to do in triggers what Oracle does perfectly well as a standard feature.
-- 
Regards,

Stephane Faroult
Oriole Ltd
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Stephane Faroult
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to