Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / Oracle / Oracle Server / February 2006

Tip: Looking for answers? Try searching our database.

Trigger needed

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Frank Weber - 27 Feb 2006 11:02 GMT
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
DA Morgan - 27 Feb 2006 17:16 GMT
> Hi,
>
[quoted text clipped - 18 lines]
>
> thanks

Is the trigger right is not the question you should be asking. The
question I would propose to you to explore, with a copy of Date and
Codd by your side is ... "Is the design right?"

1:1 relationships? It strikes me it is not.
Signature

Daniel A. Morgan
http://www.psoug.org
damorgan@x.washington.edu
(replace x with u to respond)

Andy Hassall - 27 Feb 2006 19:07 GMT
>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
[quoted text clipped - 14 lines]
>
>Is the trigger right on tblPERSI or does it belong to tblPERSN?

The trigger goes on the table being inserted into; so on "tblPERSN" would be
correct.

Signature

Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

Mark C. Stock - 28 Feb 2006 02:27 GMT
: >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
[quoted text clipped - 17 lines]
: The trigger goes on the table being inserted into; so on "tblPERSN" would be
: correct.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.