dynamic SQL in ESQL 7.22
Posted in 1998
Attention ESQL/C gurus: 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. This is driving my compiler crazy. Do I have to use some sort of void pointer to move around in my allocated memory?? The doc is not alot of help in this area. Does anyone have any examples or suggestions of dynamic INSERT / UPDATES in ESQL/C?? Any help muchly appreciated. Allen W. Jantzen, Database Admin. NDR allenj@<nospam>ndr.com Please remove <nospam> if you wish to reply via e-mail.