Re: Informix messages in 4GL
Posted in 1991
Steinar@balder.no (Steinar Overbeck Cook) writes: > If there is an ISAM error, the error code is contained in SQL.SQLERRD[2] > I have not tryed it myself, but I supoose the statement below should do > the trick. > > LET errmsg = err_get(SQLCA.SQLCODE) > LET isam_msg = err_get(SQLCA.SQLERRD[2]) Will give it a try and let ya'll know . . . > Excuse me if I'm asking silly questions, but why do you want to > have your own record for the SQLCA record. Can't you just use the predefined > SQLCA record ? Well - um, uh - I just wanted to get ALL of the SQLCA record copied into a locally-defined variable so I could mess with the contents; the example you show above [ LET errmsg = err_get(SQLCA.SQLCODE) ; LET isam_msg = err_get(SQLCA.SQLERRD[2]) ] may not work, because the SQLCA data changes after every successful statement (or so it seems). We had a situation where we couldn't get to SQLCA.SQLERRD[2] because I made the mistake of doing a "COMMIT WORK" before accessing the SQLCA.SQLERRD[2] value. Once the COMMIT WORK statement was issued, the value changed. Even if SQLCA only changes after every successful *SQL* statement, it presents a problem in terms of what we're trying to accomplish at this site (a more-or-less generic error handling routine), which is slated to include an INSERT statement into a programmer's tracking database after a fatal SQL/ISAM/FORMS error occurs. Hope that helps to explain what I'm up to . . . :-) Bill Williams ------------------------------------------------------------------------------ Milnet (Internet) address: bwilliams@aqlan.ssc.af.mil --------------------------- D I S C L A I M E R ------------------------------ The opinions expressed here do not reflect the views of the US Air Force, the Department of Defense, the US Government, or anyone else but ME. So there. ------------------------------------------------------------------------------ A 4GL "CUTTING EDGE" TECHNOLOGY SITE: AT&T 3B2 WITH ONLINE (*GASP!*) ------------------------------------------------------------------------------