Note the following points when you use the data type SQLLongDesc:
· If you want to execute INSERT statements or PUTVAL statements with host variables of data type SQLLongDesc, you must first assign values to the structure components szBuf, cbBufMax and cbBufLen of this data type.
· If you want to execute FETCH statements or GETVAL statements with host variables of data type SQLLongDesc, you must first assign values to the structure components szBuf and cbBufMax of this data type.
SQLLongDesc ldesc;
#define LONGLEN 100000
#define FILLLEN 80000
/* Assign memory for including data */
ldesc.szBuf = (char *) malloc (LONGLEN);
/* Fill memory with values */
memset(ldesc.szBuf, ‘X’, FILLLEN);
/* Specify size of memory area */
ldesc.cbBufMax = LONGLEN;
/* Specify length of data in buffer */
Ldesc.cbBufLen = FILLLEN;
EXEC SQL INSERT INTO LONGTEST VALUES (:i1, :ldata :il1, :l2 :il2);