Data types

With the C API, C data types can be specified as arguments to certain function calls. Tcl objects support a smaller set of data types. For portability, the C coding is accepted, but the result is converted to the closest Tcl datatype, or string, if there is no corresponding datatype.

For example, SQL_C_LONG, SQL_C_SLONG, and SQL_C_ULONG data are converted to Tcl objects of type Long. Correspondingly, SQL_C_DOUBLE maps to the Tcl Double type and SQL_C_BINARY maps to the Tcl ByteArray type.

Many of the input and output values are specified in terms of named constants which are implemented in C as macros. These names are all supported in Tcl as string constants. The SQLGetInfo function documents numerous bitmasks which are used to interpret the results of the function. These bitmasks are implemented in Tcl as global variables and can be used with Tcl’s bitwise operators to extract results.

For SQLDriverConnect, only the SQL_DRIVER_PROMPT value of fDriverCompletion is supported.