Coercing Character Data Types

From InterBase
Jump to: navigation, search

To coerce SQL_VARYING data types to SQL_TEXT data types, change the ­sqltype field in the XSQLVAR structure of the parameter or select-list item to the desired SQL macro data type constant. For example, the following statement assumes that var is a pointer to an XSQLVAR structure, and that it contains a SQL_VARYING data type to convert to SQL_TEXT:

var->sqltype = SQL_TEXT;

After coercing a character data type, provide proper storage space for it. The XSQLVAR field, sqllen, contains information about the size of the uncoerced data.
Set the XSQLVAR sqldata field to the address of the data.