Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking SQLCODES

Status
Not open for further replies.

Mags1972

IS-IT--Management
Feb 28, 2005
24
0
0
GB
This is probably a very simple question, but I want to check and act on certain SQLCODES obtained after a DBLOOKUP statement.

i.e DBLOOKUP(blah blah blah)....IF SQLCODE = +100 , "record isnt there" , IF SQLCODE = -803 , "Record already exists" etc etc etc...

Any Ideas???

Thanks in advance
 
I don't think you will be able to get back the database errorcodes.

Doing a LASTERRORCODE() function will return the Mercator error code (e.g. 1002 - No data found), not the SQL errorcode.

The SQL errorcode should appear in the database trace, but parsing this would be slow.

Another option would be to have some 'wrapper' around your SQL that returns your errorcode as data back to Mercator.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top