DB-Library/C datatypes

DB-Library/C defines datatypes for Adaptive Server data. These datatypes begin with “SYB” (for example, SYBINT4, SYBCHAR, SYBMONEY). Various routines require these datatypes as parameters. DB-Library/C and Server-Library/C also provide type definitions for use in program variable declarations. These types begin with the prefix “DB” (for example, DBINT, DBCHAR, DBMONEY, and so on) for DB-Library/C, and “SRV_” for Server-Library/C (for example, SRV_INT4, SRV_CHAR, SRV_MONEY). By using them, you ensure that your program variables will be compatible.

See Types for a list of Adaptive Server datatypes and corresponding DB-Library/C program variable types. See the Open Server Server-Library/C Reference Manual for a list of Server-Library datatypes.

The dbconvert_ps routine provides a way to convert data from one server datatype to another. It supports conversion between most datatypes. Since Adaptive Server and Open Server datatypes correspond directly to the DB-Library/C datatypes, you can use dbconvert_ps widely within your application. The routines that bind server result columns to program variables—dbbind and dbaltbind—also provide type conversion.