Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to get Error codes from Sybase Database

843859Oct 16 2007 — edited Oct 18 2007
Hi,

I have a table"table1" which has a field:AppId and constraints are "Unique" and "Ignore_duplicate_keys" ...

procedure xyz inserts the data into the table "table1".
if i enter the data with the AppId which is already there in the table i dont get any exception because ignore_duplicate_keys is set to that field.


The Error code for this 3604.

My question is how would i know that the AppId which i have entered is duplicate. because i cant get the error code from my callable statment as it does not through any sqlexception .. It just ignores the record if the appid is already there..

i would want to get the error code when i do execute and see if error code is 3604 and if so then print "Duplicate AppId"..
I dont want to change anything in the table...If any of you experts can give a soulution for this it would be greate.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 15 2007
Added on Oct 16 2007
3 comments
197 views