cancel
Showing results for 
Search instead for 
Did you mean: 

How to make JDBC response error when insert duplicated data

Former Member
0 Kudos

Hi all experts

     I am a new PI developer. Now, i have to configure HTTP to JDBC scenario. if data is valid likes unique primary key, it can be inserted into database successfully and response from JDBC adapter like this : <insert_count>1</insert_count>. But when duplicated primary key is inserted, error will occur in the adapter and no response document. So I would like to ask you all that  are there any ways to provide response message so that it can do mapping to notify error when insert duplicated data ?. Thanks for advance

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Panupong,

If the case is to get the error response in case of duplicate entry, you need ask your Database team to put some trigger on primary key, if it fails an trigger will generate an fault message with error type & you catch the fault message in PI & pass it on to the sender application.

one suggestion would be to do a lookup in the database table for any duplicate entry & if already entry there then do no perform any action on the table.

One design also can be ask you database team to write an stored procedure which will handle all the functionalties easily.

Regards,

Ashish

Former Member
0 Kudos

Thanks Ashish, your suggestion is helpful. I will try to use this approach

Answers (0)