Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Foreign key referencing two table (either-or)

IniyavanJul 26 2019 — edited Aug 7 2019

Hi friends,

I have three tables as below:

TB_CHILD

(COL_1 INTEGER,

REF_COL VARCHAR2(10));

TB_PARENT_1

(REF_COL VARCHAR2(10));

TB_PARENT_2

(REF_COL VARCHAR2(10));

A foreign key should be created on TB_CHILD.REF_COL, whose value should be present in either TB_PARENT_1.REF_COL or TB_PARENT_2.REF_COL.

How can we create the FK. My Oracle version is 12.2

Comments
Post Details
Added on Jul 26 2019
11 comments
1,428 views