• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

parent key not found

 
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,?,?,?,?,?,?,?,?,?,?,?,?,?)";
 
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.
 
Live a little! The night is young! And we have umbrellas in our drinks! This umbrella has a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!