473,402 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Constraints with several father tables

Hi,

I have 4 tables: "T_father1",...,"T_father4".
In relation to these father-tables I have a child-table: "T_Child"
(with only 1 foreignkey-field: FsID) alread filled with some records.

That means each record of "T_Child" has in its field "FsID" a primary
key of one of the 4 father tables.

If I want to create the 4 foreign-key CONSTRAINTS:
"T_Child.FsID <-> T_FatherX.ID" (X=1..4)
I get an Oracle-error (Ora-02298): "cannot validate".

My question is:
How can I tell Oracle (how do I have to create the Constraint), that
this foreignkey-field "T_Child.FsID" is not the foreign-key to ONE
father-table but to FOUR father tables ?
Or is this "bad database design" to have one foreignkey-field for 4
father tables ?

Thanks in advance for any help, suggestionst or comments !!
Best regards
Ralf Miko
Jul 19 '05 #1
1 3219
Mi**@boehrer.de (Ralf) wrote in message news:<fa**************************@posting.google. com>...
Hi,

I have 4 tables: "T_father1",...,"T_father4".
In relation to these father-tables I have a child-table: "T_Child"
(with only 1 foreignkey-field: FsID) alread filled with some records.

That means each record of "T_Child" has in its field "FsID" a primary
key of one of the 4 father tables.

If I want to create the 4 foreign-key CONSTRAINTS:
"T_Child.FsID <-> T_FatherX.ID" (X=1..4)
I get an Oracle-error (Ora-02298): "cannot validate".

My question is:
How can I tell Oracle (how do I have to create the Constraint), that
this foreignkey-field "T_Child.FsID" is not the foreign-key to ONE
father-table but to FOUR father tables ?
Or is this "bad database design" to have one foreignkey-field for 4
father tables ?

Thanks in advance for any help, suggestionst or comments !!
Best regards
Ralf Miko

I wouldn't even call this design. Multiple foreign keys in multiple
tables to 1 PK are definitely possible. One foreign key to multiple
parents of course not.
Your parent table must be falling apart in several subtypes. Hence you
need to differentiate.

Sybrand Bakker
Senior Oracle DBA
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Rajesh Kapur | last post by:
We use InnoDB tables and foreign key constraints extensively. The mysqldump backs up the database tables in alphabetical order with foreign key constraints defined in the create statement of each...
0
by: jason_s_ford | last post by:
I have several sql server databases that were recently moved to a new server. In the process of migrating the databases, any triggers and constraints attached to tables were removed on accident. ...
2
by: Davy | last post by:
My program deal with a several level tree with several branchs. The amount of branchs from father node is not known. So I want to creat a tree with dynamic branchs. Now I use the structure:...
10
by: serge | last post by:
I am doing a little research on Google about this topic and I ran into this thread: ...
0
by: BobTheDatabaseBoy | last post by:
i've Googled some this morning, but to my surprise, i don't find any offering (for fee or open source), which would integrate with, say Jakarta Struts, to provide the UI edits from cataloged...
0
by: Frnak McKenney | last post by:
One part of a customer project I'm working on involves what seem like fairly straightforward updates to a set of related tables. While I've developed software for a number of years (it only seems...
3
by: David Parker | last post by:
I would like to be able to truncate all of the tables in a schema without worrying about FK constraints. I tried issuing a "SET CONSTRAINTS ALL DEFERRED" before truncating, but I still get constraint...
4
by: G .Net | last post by:
Hi I have a DataSet with several DataTables. I have set up relations between these tables. I want to delete all the tables and re-fill them. However, when I try to do so, even after using...
1
by: Ralf | last post by:
Hi, I have 4 tables: "T_father1",...,"T_father4". In relation to these father-tables I have a child-table: "T_Child" (with only 1 foreignkey-field: FsID) alread filled with some records. That...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.