|
On 2/9/07, BirgittaHauser <Hauser@xxxxxxxxxxxxxxx> wrote:
Hi, If you are not yet on release V5R3, you can get the error message as follows: All SQL messages are stored in the message file QSQLMSG. The message id for an SQL code consists of SQL + the absolute value of the SQLCOD. (if the absolute SQLCODE is < 10000). If it's > than 1000 the message-id is SQ + the absolute value of the SQLCOD. I.e. SQLCOD -204 --> Message-Id SQL0204. The variable message textes are returned in the field SQLERM in the SQLCA. With this information it's quite easy to retrieve the message text from the message file. If you are already on release V5R3 or higher, you can retrieve the message text over the SQL-Statement GET DIAGNOSTICS. The following statement can be executed after any SQL statement to retrieve the message text. (MsgText is a variable defined in the D-Specs. C IF SQLCODE < *Zeros C/EXEC SQL Get Diagnostics Condition 1 :MsgText = MESSAGE_TEXT C/END-EXEC C EndIf
Wow, I am so glad I asked! We *are* on V5R3 and this is the first I've heard of GET DIAGNOSTICS. It covers 20-some pages in the SQL reference! I will have to spend some time going through this. Has this been written up in an article that's available online? I'll have to search for it. Thanks! - Dan
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.