|
Chris, The SQL errors returned by SQLCOD correspond to SQL error messages. The following shows how to convert them to messages. 1. Determine the SQL code. Variable name is SQLCOD. 2. If the SQL code is negative, replace the '-' with a zero and concatenate the last 4 positions to 'SQL'. 3. If the SQL code is positive and < 10,000 concatenate the last 4 positions to 'SQL'. 4. If the SQL code is > 10,000 concatenate the last 5 positions to 'SQ'. 5. You should now have a message number in the form SQLXXXX or SQXXXXX. 6. Run the command DSPMSGD SQLXXXX MSGF(QSQLMSG) In code it looks like this: EvalR ChrErr# = Success + %Char(sqlCod); Select; When sqlCod < 0; ChrErr# = %XLate('-' :'0' :ChrErr#); spmMsgID = 'SQL' + %subst(ChrErr# :4 :4); When sqlCod < 10000; spmMsgID = 'SQL' + %subst(ChrErr# :4 :4); Other; spmMsgID = 'SQ' + %subst(ChrErr# :3 :5); EndSl; HTH, Rick -----Original Message----- From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx]On Behalf Of c.chambers@xxxxxxx Sent: Friday, August 13, 2004 8:26 AM To: midrange-l@xxxxxxxxxxxx Subject: SQL status code values Can - anyone direct me to a list of values returned in the SQLSTATE keyword in embedded SQL statements. Or more specifically what does Status 42704 mean? I have searched in vain Regards etc, Chris -- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.