Insert adapter throwing error

Hi All,

I was having one existing Insert JDBC adapter. This adapter is inserting data into table which have 4 columns .Out of four column one column act as foreign key to another table.
let us say I have table A on which I have build up my Insert adapter and one of the column in table A act as foreign key to another table say table B .
Now I have added one new row to table B and running my insert adapter with new values but it is throwing error as
com.ibm.db2.jcc.am.SqlIntegrityConstraintViolationException: DB2 SQL Error: SQLCODE=-530, SQLSTATE=23503, SQLERRMC=CWM10304, DRIVER=4.19.26

When I am running same insert query directly in database it is working fine data is getting insert in table A successfully .

Can anybody please help me with above issue .Please let me know if you need more information .

1 Like

Hi Swapnil,

what is your transaction type on the connection?

Regards,
Holger

1 Like

Hi Swapnil,

This issue happens when you are trying to add a value to a foriegn key column which doesn’t have corresponding primary key value. So, please check the table having the primary key to see if value of any of the column matches with the value you are adding. If not, please do so.

Regards,
Raviteja.