Re: Review - mailme.4gl
Posted in 1994
}Date: Fri, 4 Mar 94 12:49:17 MST }From: alan@po.den.mmc.com (Alan Popiel) }To: p.botcherby@miranda.umds.ac.uk }Subject: Re: Review - mailme.4gl }X-Informix-List-Id: <list.3619> }->Date: Fri, 4 Mar 94 17:36:53 GMT }->From: pkb@uk.ac.umds.pru1 (Peter Botcherby) }->To: alan@po.den.mmc.com }->Subject: Re: Review - mailme.4gl }->->Please let me know how/if the function that I posted works for you. I }->->try to write portable code, but I am still comparatively new to C, and }->->it keeps me very humble. }->Thanks for the function - I am also not that familiar with calling c }->routines from Informix especially since I only have the RDS environment. }->However, after RTM I have partially got your function working. Your }->function is fine its Informix which is playing up. If I call your }->function as you suggested its works great as long as I run it under the }->new runner I created for the debugger but when I run it with the new }->runner normally the (%s) is replaced by (). I have tried several ways }->of passing the arguments but none work except with the debugger. I have }->modified the c code to write out the contents of the variables and to }->trim the trailing space so that you can see its doing something. I }->think I may have come across another bug in Informix. }Using the C routine with RDS does add a new wrinkle to things. It is }possible that the RDS in normal mode is not filling in the SQLCA.SQLERRM }field. On p. 3-77 of the Informix-4GL Reference Manual, Volume 1, for }Version 4.00, it says "SQLERRM is not used at this time." However, my }ancient (1.10.03F) version of compiled 4GL does indeed fill in that field. } }I have heard of subtle differences like this between the compiled and }interpreted versions. It may not be a bug, just an incomplete port. }Since the manual says the field is not used, Informix is in a fairly }strong position to say something like, "If it works on your port, fine; }if it doesn't, well we didn't say it would, did we?" This comes down to a difference between RDS and (compiled) I4GL. I4GL is compiled into ESQL/C and therefore the SQLCA structure is handled by ESQL/C, and SQLCA.SQLERRM is filled in appropriately by ESQL/C. This includes both SQLERRM and SQLERRP (though to be quite honest, I've no idea whether there is anything useful in it even for ESQL/C programmers). However, RDS (and Interactive Debugger, ID) are much more complex beasties, and the ESQL/C SQLCA record is copied into the RDS-defined record of the same name that your application handles. Up to and including version 4.11, the SQLCA.SQLERRM part of the data was not set at all; in version 4.12, it is set. In no version of RDS or ID is the SQLCA.SQLERRP part of the record set. It will therefore contain a null string (probably) unless you place something there. This change was made to be able to support the fix to bug B22738 correctly. B22738 is "ERR_GET DOES NOT RETURN TABLE NAME WHEN SQLCODE PASSED IS -206". This is fixed in version 4.12 in I4GL, RDS and ID. This isn't one of the bugs claimed as fixed in the release notes as it didn't receive the final blessing of QA until after the release notes were made up. Version 4.12 will probably be available from some time next week on Sun and HP; other ports to follow as usual. It has left my hands, anyway, barring someone finding a disaster in it. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>