Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

parent key not found

 
Pradeep
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Pradeep
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic