Re: How to get full error message?
Posted in 1994
}From: slitel@cadre.com (Stuart Litel) }Subject: Re: How to get full error message? }Date: 10 Feb 94 15:24:00 GMT }X-Informix-List-Id: <news.5494> } }rob@dssmktg.com (Robert Minter) writes: }>From Richard Spitz: }>* Just a couple of weeks ago, there was a thread in this group about how }>* to get the full error message in an ESQL/C program, using the rgetmsg() }>* function. At that point, I was SURE I'd NEVER have to use this. Well,... }>* }>* This function works fine, however, the output is like: }>* -217: Column (%s) not found in any table in the query. }>* }>* Could somebody please re-post or preferably mail me the solution on how }>* to get the "%s" resolved? }> }>From what I've found playing around with the err_get in 4gl is that }>when an error occurs, the replacable parameters to be put into the }>string returned by err_get() ( rgetmsg() for ESQL/C ) are found in the }>sqlca.sqlerrm variable. } }This is true in the RDS version. In the compiled version the "%S" will }be replaced for you. I do not think you can comlain to Informix since it is }not officially supported. Someone did, and it became bug B22738, and it is/will be fixed in version 4.12 for both compiled I4GL and the p-code versions. With version 4.12, when you call err_get() or any of it's friends, if the error message contains a "%s", it will be reformatted using sprintf() and the text from sqlca.sqlerrm will be substituted. The only problem will be if the test contains "%d", in which case, the address of sqlca.sqlerrm will be printed as a decimal number. This is unlikely to affect any of your code, but did affect some of the internals of the products. The place where you are most likely to see the problem is if you manage to run out of disk space (or encounter some other error) during a LOAD or UNLOAD operation; the secondary fix (B23188) may not be in the 4.12.UC1 portmaster. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>