How to get Error codes from Sybase Database
843859Oct 16 2007 — edited Oct 18 2007Hi,
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.