User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Oracle section within the Web Development category of DaniWeb, a massive community of 423,351 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 5,238 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Oracle advertiser: Programming Forums
Views: 853 | Replies: 3 | Solved
Reply
Join Date: Mar 2007
Location: KSA
Posts: 9
Reputation: ally1002 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
ally1002's Avatar
ally1002 ally1002 is offline Offline
Newbie Poster

error, dont get it.

  #1  
May 29th, 2008
hello, i'm fairly new to oracle, but i pretty much get it. anyway i've created a table using this code :
create table BanquetReservation(
ResNo SMALLINT NOT NULL,
Restriction varchar(30) not null,
ResType varchar(10) not null,
DateOfEvent Date not null,
NoOfPeople SMALLINT NOT NULL,
EndDate Date,
StartDate Date,
SSN CHAR(9) NOT NULL,
BYear SMALLINT NOT NULL,
SID   SMALLINT  not null,
primary key (ResNo),
foreign key (SSN) REFERENCES Customer,
foreign key (BYear) REFERENCES Budget,
foreign key (SID) REFERENCES BanquetStaff);

and alls well, its just when i try to insert into the table:
Insert INTO BanquetReservation VALUES(100010,'None','Seminar','15-APR-04',400,'15-APR-04','1-APR-04',999887777,2004,12345);

i get this error message:
ORA-02291: integrity constraint (10212_S6.SYS_C00133029) violated - parent key not found

and i'm sure of the foreign keys that i used are the same type and that their already inserted into the other tables and everything,it says parent key not found but it is! can it mean smthg other than parent key not found?yeah and the little * that tells u where the problem is , is at the beginning under insert. so pls help.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2008
Posts: 2
Reputation: ackness is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
ackness ackness is offline Offline
Newbie Poster

Re: error, dont get it.

  #2  
May 30th, 2008
Originally Posted by ally1002 View Post
hello, i'm fairly new to oracle, but i pretty much get it. anyway i've created a table using this code :
create table BanquetReservation(
ResNo SMALLINT NOT NULL,
Restriction varchar(30) not null,
ResType varchar(10) not null,
DateOfEvent Date not null,
NoOfPeople SMALLINT NOT NULL,
EndDate Date,
StartDate Date,
SSN CHAR(9) NOT NULL,
BYear SMALLINT NOT NULL,
SID   SMALLINT  not null,
primary key (ResNo),
foreign key (SSN) REFERENCES Customer,
foreign key (BYear) REFERENCES Budget,
foreign key (SID) REFERENCES BanquetStaff);

and alls well, its just when i try to insert into the table:
Insert INTO BanquetReservation VALUES(100010,'None','Seminar','15-APR-04',400,'15-APR-04','1-APR-04',999887777,2004,12345);

i get this error message:
ORA-02291: integrity constraint (10212_S6.SYS_C00133029) violated - parent key not found

and i'm sure of the foreign keys that i used are the same type and that their already inserted into the other tables and everything,it says parent key not found but it is! can it mean smthg other than parent key not found?yeah and the little * that tells u where the problem is , is at the beginning under insert. so pls help.



Use this query to find out which table/column is the one raising the error:

SELECT * FROM user_cons_columns
WHERE constraint_name = Upper('<constraint_name_goes_here>')

Once you know which table/column, do a query to verify that the value in you insert statement is indeed in the table.
Reply With Quote  
Join Date: Feb 2008
Posts: 2
Reputation: ackness is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
ackness ackness is offline Offline
Newbie Poster

Re: error, dont get it.

  #3  
May 30th, 2008
SELECT * FROM user_cons_columns
WHERE constraint_name = Upper('demo_order_items1_fk')
Reply With Quote  
Join Date: Mar 2007
Location: KSA
Posts: 9
Reputation: ally1002 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
ally1002's Avatar
ally1002 ally1002 is offline Offline
Newbie Poster

Re: error, dont get it.

  #4  
May 30th, 2008
yea thanx i think itll help. but i didnt create any constarints.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Oracle Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Oracle Forum

All times are GMT -4. The time now is 11:53 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC