I have a Main table with 7 Primary keys.
I also have a Child table which I want to relate it to Main table via Foreign keys.
Can I use the 6 Foreign keys in Child Table as reference to only the 6 primary keys instead of 7 to the Main Table.
When I am doing this I am getting Errors as:-
SQL State = 42890 SQL Code = -573 SQL Message = A column list specified in the references clause of constraint "FL_DESIG..." does not identify a unique constraint of the parent table or nickname "MBID.TMST". Exception message = com.ibm.db2.jcc.c.SqlException: A column list specified in the references clause of constraint "FLI_DESIG..." does not identify a unique constraint of the parent table or nickname "MBID.TMST".
Best Regards, Guy Przytula
Database Software Consultant
Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
Information Server Datastage Certified http://www.infocura.be
pratikp.vasani, I think what you mean is you have 1 Primary key consisting of 7 columns. You have another table where you want to create a RI rule based on 6 columns from the Child table to only 6 of the 7 columns in the Primary Key on the Parent table.
The answer is No, you can't do that. If you have 7 columns in the Primary Key, the the Foreign Key also has to have 7 columns.