cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC : Unique constraint violated error possible in UPDATE_INSERT action ?

Former Member
0 Kudos

Hi Friends,

I am working on a receiver JDBC adapter .I caught with an error <b>Unique constraint violated</b> I know this occur when we are trying to insert a record with a duplicate key value.But question is i am using UPDATE_INSERT action , in this case it record exits it should update the record. .Then why it is happening like this?Can any one answer to me and correct me if i am wrong?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Ravi,

Can you just execute the query at the database level and see whether it is working fine or not? If it is in production please take care.

---Satish

Former Member
0 Kudos

Satish,

At database level UPDATE working properly.But from XI it not identifying the record with the same key.

Is any field datatype problem? In my statement key field datatypes are number,varchar and DATE .

Is there any thing i need to take care at key field datatypes?Can any one answer this?

agasthuri_doss
Active Contributor
0 Kudos

Hi,

>> Is any field datatype problem? In my statement key field datatypes are number,varchar and DATE

Should not be problem beacuse of data type

Regards

Agasthuri Doss

Former Member
0 Kudos

Hi friends,

JDBC receiver :

If even one record is error out in the receiver JDBC query rest of the success records are not posting .If there any when that i can send success records even some records are error out.

I configured RECEIVER Jdbc :

Transaction Isolation level ; serializable

and checked Database auto commit Enabled.

Please let me know if any thing i have to do to meet this?

Former Member
0 Kudos

Ravi,

Click on the Advanced mode in Receiver JDBC cc and add the parameter

logSQLStatement true

This will help you in figuring out the query formed at the cc. Check if you can execute this query at database level. My feeling is that key values are not sent corectly..

Regards,

Jai Shankar

Former Member
0 Kudos

Did you pass the correct primary key values to UPDATE_INSERT. Looks like its trying to insert and its failing since its not finding the key value when its first searches for the record. Please make sure that you are passing all Primary key fields in the UPDATE_INSERT.

--Archana

Former Member
0 Kudos

If it not find key then it should insert record right.

Former Member
0 Kudos

yes, but thats when its failing. So, make sure you why its not able to find the record with the key you have passed. I'm sure if you pass the right key values it will work.

Former Member
0 Kudos

Ravi,

Are you using MS SQL server database?

Bipin

Former Member
0 Kudos

No i am using Oracle database

Former Member
0 Kudos

Archana,

I am very much sure, key that was passing is right.

Former Member
0 Kudos

Ravi,

There might be some problem with unique index in the database .Probably it is corrupted .You may have to drop this unique index and create it again using your primery key.

Bipin