Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to create multiple foreign keys

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
sqljunkie

New User


Joined: 03 May 2006
Posts: 2

PostPosted: Fri May 05, 2006 9:40 am    Post subject: How to create multiple foreign keys
Reply with quote

Hi,

I have table1,table2,table3,table4

table1 i created with account number as primary key: worked fine
table 2 i created with account_number and account_ind as primary key and references table1.account number as foreign key : worked fine

now while creating table 3 -my primary key is accout_ number and table_4 ind and foreign key should be table2.account number and table2.account_ind
-this fails saying

DSNT408I SQLCODE = -538, ERROR: FOREIGN KEY TABCFK DOES NOT CONFORM TO THE
DESCRIPTION OF A PARENT KEY OF TABLE TABLE2

Can someone tell me what iam doing wrong.
Back to top
View user's profile Send private message

cheryala

New User


Joined: 20 Mar 2006
Posts: 46

PostPosted: Fri May 05, 2006 12:18 pm    Post subject:
Reply with quote

Hi
What I believe is you can't create a foriegn key on another foreign key..
Instead of pointing to table2.account_number ...try using table1.account_number ...

Cheers,
Cheryala
Back to top
View user's profile Send private message
perez_a

New User


Joined: 02 Feb 2006
Posts: 25
Location: Italy

PostPosted: Fri May 05, 2006 5:01 pm    Post subject: Re: How to create multiple foreign keys
Reply with quote

Hi sqljunkie,
have u cecked that
accout_ number table_4 ind are some type of
account_number account_ind ?
If yes, please write the code that u have used for more detail.
Have a nice day, Alex icon_wink.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Splitting one row into multiple Rows ... Rajan Moorthy DFSORT/ICETOOL 9 Mon May 14, 2018 10:58 pm
No new posts Need better approach to create a sort... Vamshi Veludandi DFSORT/ICETOOL 8 Thu Mar 08, 2018 5:59 pm
No new posts write multiple lines in PS file in cobol Balu5491 COBOL Programming 7 Wed Mar 07, 2018 10:27 am
No new posts Using multiple routines at exit 6 in ... Randy Horowitz All Other Mainframe Topics 2 Sat Feb 10, 2018 11:57 pm
No new posts Can we create REXX ouput in an Excel ... upendrasri CLIST & REXX 3 Wed Jan 17, 2018 8:19 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us