Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Getting a parent key error

Author  Topic 

matthew15
Starting Member

3 Posts

Posted - 2008-06-19 : 18:11:28
i get a error message like this: Table RENTAL_ITEM in RENTALB23 does not have a matching parent key.

this is the sql:
CREATE TABLE RENTALB23/RENTAL_ITEM (RENTALITEM# INT PRIMARY KEY,
RENTALTYPE CHAR(3), TITLE CHAR(30), CATEGORY CHAR(15), DUEDATE DATE,
FOREIGN KEY(RENTALTYPE) REFERENCES
RENTALB23/RENTAL_CHARGE(RENTALTYPE), FOREIGN KEY(CATEGORY)
REFERENCES RENTALB23/RENTAL_CHARGE(CATEGORY))

this is the sql for the rental_charge table:
CREATE TABLE RENTALB23/RENTAL_CHARGE (RENTALTYPE CHAR(3),
CATEGORY CHAR(15), CHARGE DECIMAL(5,2), PRIMARY KEY(RENTALTYPE,
CATEGORY))

any ideas what can cause this?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-19 : 18:12:38
Your question doesn't appear to be for SQL Server. What dbms are you using?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

matthew15
Starting Member

3 Posts

Posted - 2008-06-19 : 18:16:28
oh i forgot that, i'm using iSeries it's db2 i think...im new so i don't know exactly what it is but i know im using iSeries (as/400)
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-19 : 18:18:18
Try posting your question in the appropriate forum over at dbforums.com.

SQLTeam.com is for Microsoft SQL Server, which is on the Windows platform.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

matthew15
Starting Member

3 Posts

Posted - 2008-06-19 : 18:19:23
ok thanks for the link
Go to Top of Page
   

- Advertisement -