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 -> Trigger needed

Trigger needed

From: Frank Weber <frank_at_frankweber.com>
Date: Mon, 27 Feb 2006 12:02:56 +0100
Message-ID: <dtum99$4bd$1@online.de>


Hi,

I have a database among 6 tables. Each record goes from the main table to 5 other tables via 1:1 relation. A new record is only inserted once in the main table tblPERSN, and the primary key ID_PERSN should become inserted in the 5 other tables as a foreign key (ID_PERSI, ...). What trigger is right? Insert in tblPERSN must be followed by an insert in tblPERSI.
I think it should look something like that?

AFTER
INSERT OF ID_PERSN ON myuser.tblPERSN
NEW AS ID_PERSN
BEGIN
Insert into tblPERSI
Values (ID_PERSI := new.ID_PERSN,,,,,,); (... entry for each table)
END; Is the trigger right on tblPERSI or does it belong to tblPERSN?

thanks Received on Mon Feb 27 2006 - 05:02:56 CST

Original text of this message

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