using -746 error number
Posted in 2009
Topics: Error Codes & Troubleshooting
Hi all, A developer want to use -746 error number, but instead of use isam 0 he wants to use isam error from 1 to 10 for aditional porpouses... Any advice about it? or can he use it without problems? regards
On Tue, Feb 17, 2009 at 2:50 PM, PAULO RAFAEL PADILLA <rafaelpadilla@grupomayan.com> wrote: > A developer want to use -746 error number, but instead of use isam 0 he wants > to use isam error from 1 to 10 for aditional porpouses... > > Any advice about it? or can he use it without problems? I use error -746 plus a sensible ISAM error code to indicate problems in SQLCMD. The only major caveat is that if you set the ISAM error code to a message number that has '%s' format strings in it, you have to be very careful with your error formatting on the client side. The other point is that ISAM errors 1..10 will be reported as the equivalent system errors (for errno = 1..10) unless you take care to do otherwise. So, since you can return three bits of information with an SPL exception (an SQL error, an ISAM error, and a string that goes into sqlerrm in the sqlca structure), you may as well use them. For those not familiar with error -746, it is an error message that consists of a single %s and a newline; what you place in the sqlerrm string is what will appear as the main error message. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2008.0513 -- http://dbi.perl.org/ "Blessed are we who can laugh at ourselves, for we shall never cease to be amused." NB: Please do not use this email for correspondence. I don't necessarily read it every week, even.
Thanks Jonathan I will take your tips!