SQLDA Type Codes
The following table lists the type codes to use with BASIC variables that are pointed at by the sqldata pointers.
As described in the section (see page
BASIC Variables and Data Types), all other types are compatible with the above BASIC data types. For example, you can retrieve an SQL
date into a
string variable, while you can retrieve
money into a
double variable.
Nullable data types (those variables that are associated with a null indicator) are specified by assigning the negative of the type code to
sqltype. If the type is negative, you must point at a null indicator by the
sqlind variable. The type of the null indicator must be a 2-byte integer, a
word variable. For information on how to declare and use a null indicator in BASIC, see
BASIC Variables and Data Types in this chapter.
Character data and the SQLDA have the exact same rules as character data in regular Embedded SQL statements. Because string lengths must be assigned to
sqllen before using the SQLDA, you cannot point at BASIC dynamic string variables (those declared without a length) if they have not yet been assigned any storage. For more details on character string processing in SQL, see
BASIC Variables and Data Types in this chapter.