aspose file tools*
The moose likes Oracle/OAS and the fly likes parent key not found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "parent key not found" Watch "parent key not found" New topic
Author

parent key not found

Pradeep
Ranch Hand

Joined: Sep 19, 2006
Posts: 49
i am getting following error, when insert the data into table

java.sql.SQLException: ORA-02291: integrity constraint (KMS.FK_WK_FUND_ENTITY_02) violated - parent key not found


my query also not working in toad shows same error


query is as follows :

INSERT INTO WK_SHARE VALUES('1233',wk_share_seq.NEXTVAL,'','sxd','asz','jkl','hji','iko','mnj','klo','N','132','39','y','0')


public static final String AD_SHARE = "insert into wk_share values(?,wk_share_seq.nextval,?,?,?,?,?,?,?,?,?,?,?,?,?)";
Srinivasa Raghavan
Ranch Hand

Joined: Sep 28, 2004
Posts: 1228
Let me give you the solution indirectly.

Create a table called Department with all necessary details
Create a Table Employee with all necessary details it should also have a column called DeptNo and this column should refer to DeptNo column in department table ( Create a REFERENTIAL Integrity Constraint )

insert two rows with departmentNo 10 & 20 in department table insert a row with departmentNo 30 in emp table
[ November 28, 2006: Message edited by: Srinivasa Raghavan ]

Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
Pradeep
Ranch Hand

Joined: Sep 19, 2006
Posts: 49
thanks Srini

i got solution from your example.

i was doing like same in my table by inserting differnt value

for fundid column which is common for another table also.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: parent key not found