Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Trigger needed
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
![]() |
![]() |