Re: using SQLDA in ESQL/C gets (n-1) from char(n) field
Posted in 1994
}Date: Wed, 2 Mar 94 20:19 GMT }From: dlima@tcsernet.tcs.ernet.in }Subject: using SQLDA in ESQL/C gets (n-1) from char(n) field }X-Informix-List-Id: <list.3603> } }When I use the SQLDA structure in a program to retrieve }a database table field whose type is char(n), only }n-1 characters are actually retrieved! } }The problem is most severe with n=1 or a field type char(1). } }I am acessing the sqlvar.sqldata and sqlda. }sqlvar.sqllen members of the sqlda structure with sqltype=SQLCHAR. } }The memory allocated in the program is for (sqlvar.sqllen+1) bytes }to the sqlvar.sqldata pointer. } }This was reported to Tech Support as 266450 who indicated that }the table field should be made char(2) instead. That is }not acceptable in my application. Why? }Does anyone have any clues? I use ESQL/C that comes with INFORMIX5.0. Convert the type from SQLCHAR to CFIXCHAR. Yours tersely, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>