Re: dynamic SQL in ESQL 7.22
Posted in 1998
Allen Jantzen wrote: > I am attempting to utilize dynamic SQL in an ESQL 7.22 app. > SELECT statements seem fairly easy in this regard, however I am > trying to use dynamic INSERT and UPDATE statements. > > I am using the sqlda and sqlvar_struct structures and am malloc()'ing > memory to hold the values that will replace the question marks in my > dynamic INSERT and UPDATE statements. > > However, I am very confused with this notion of placing pointers into > sqlvar_struct->sqldata which point into my allocated memory. I am > dealing with different types of data (CHAR, DECIMAL, INT), but am > attempting to move around with a CHAR pointer. In addition, I am > using various ESQL functions to convert the data into the appropriate > type, since it is all CHAR at the source. Take a good look at the code in SQLCMD which is in the IIUG archives at http://www.iiug.org. I wrote it, but it handles all the types in 7.22 without any problems, including conversion to/from characters. > Please remove <nospam> if you wish to reply via e-mail. Fortunately for you, your reply-to address is not mangled, so you are getting a response -- I don't reply to people with mangled reply-to addresses. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix -- see http://www.perl.com/CPAN #include <disclaimer.h>