java.sql.batchupdateexception

Hi getting this exception.any idea how to remove this

Caused by: java.sql.BatchUpdateException: Missing key in referenced table for referential constraint (webadrep.det_fk).

at com.informix.jdbc.IfxPreparedStatement.executeBatch(IfxPreparedStatement.java:3437)

at com.dhl.auditdatamgr.dao.AuditDAO.setDetailedAuditData(AuditDAO.java:94)

... 1 more

[378 byte] By [smita_smitaa] at [2007-10-3 3:35:01]
# 1

You did not tell us the type of database, show us the update statement, or show us the table definitions. Also, I suspect this is a database question, not a Java question.

But, from the error message, I would say that you are updating a field to a value that does not exists in another table which is defined as a foreign key to the column you are updating. The value needs to be in the foreign key table first.

jbisha at 2007-7-14 21:29:39 > top of Java-index,Java Essentials,Java Programming...
# 2

Hi the databse is informix

I can not show the daatbase stament as entering the statement through telent means manuaaly any how I have screenshot of database

constarint name referenced column refrencing table refrencing column

det_fk iata_codedetail auditatiata

facility_codedetail auditatfacility

smita_smitaa at 2007-7-14 21:29:39 > top of Java-index,Java Essentials,Java Programming...
# 3
better if you could give your email address so that I can send u some screenshots
smita_smitaa at 2007-7-14 21:29:39 > top of Java-index,Java Essentials,Java Programming...
# 4
You can upload screenshots here (and then post the link to it): http://www.imageshack.us/
doremifasollatidoa at 2007-7-14 21:29:39 > top of Java-index,Java Essentials,Java Programming...
# 5
http://img179.imageshack.us/img179/7798/1kg9.png http://img179.imageshack.us/my.php?image=2we7.png
smita_smitaa at 2007-7-14 21:29:39 > top of Java-index,Java Essentials,Java Programming...
# 6

It still appears you are trying to update a column with a value that does not exist in the foreign table. The only way the update will work is if you add the value in the foreign key table first.

Try performing the update manual in whatever tool informix uses and get it working there first.

jbisha at 2007-7-14 21:29:39 > top of Java-index,Java Essentials,Java Programming...
# 7
hI thanxs got your point.now workingregards
smita_smitaa at 2007-7-14 21:29:39 > top of Java-index,Java Essentials,Java Programming...