Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Datamodeling - Generic Arc Design
Sounds like a job for triggers to me. You probably need to have a column in
Table A that indicates which table (B or C) it the row is referencing.
Something like this:
Table A
ID number PARENT_TYPE varchar2(1) -- This will be 'B' or 'C'
Make a packaged procedure something like this:
/*
end tableATrigPkg;
/
And add a trigger like this:
create or replace trigger biur_table_a
before insert or update on table_a
for each row
begin
HTH, Diana
-----Original Message-----
From: Jeff Cox [mailto:jeff.cox_at_ips-sendero.com]
Sent: Monday, October 30, 2000 1:30 PM
To: Multiple recipients of list ORACLE-L
Subject: Datamodeling - Generic Arc Design
Hello,
I am creating a Table Instance Chart from an E-R diagram and was wondering if there is a "rule of thumb" on how to reference the foreign key for my Arc.
I need to create my foreign key reference for Table A which MUST pull the primary key from EITHER Table B or Table C. This foreign key is also part of the primary key for Table A.
Any help is appreciated.
Thanks!
Jeff Cox
IPS-Sendero
Scottsdale, AZ
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Jeff Cox INET: jeff.cox_at_ips-sendero.com 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: ListGuru_at_fatcity.com (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 mayReceived on Mon Oct 30 2000 - 15:51:31 CST
![]() |
![]() |