Types

Open Server supports a wide range of datatypes. These datatypes are shared with CS-Library and Client-Library. In most cases, they correspond directly to Adaptive Server datatypes.

Table 2-37 lists the Open Server type definitions, together with their corresponding type constants and Adaptive Server datatypes. More detailed information on each datatype follows the chart.

2.0 Open Server datatypes are included in this version for the sake of backward compatibility. 2.0 Server-Library routines must use 2.0 datatypes in this version. Table 2-37 summarizes the Open Server datatypes that all routines must use in future Open Server versions.

Table 2-37: Datatype summary

Type

Open Client and Open Server type constant

Description

Corresponding Open Client and Open Server type definition

Corresponding Adaptive Server datatype

Binary types

CS_BINARY_TYPE

Binary type

CS_BINARY

binary, varbinary

CS_LONGBINARY_TYPE

Long binary type

CS_LONGBINARY

NONE

CS_VARBINARY_TYPE

Variable-length binary type

CS_VARBINARY

NONE

Bit types

CS_BIT_TYPE

Bit type

CS_BIT

boolean

Character types

CS_CHAR_TYPE

Character type

CS_CHAR

char, varchar

CS_LONGCHAR_TYPE

Long character type

CS_LONGCHAR

NONE

CS_VARCHAR_TYPE

Variable-length character type

CS_VARCHAR

NONE

CS_UNICHAR_TYPE

Variable-length or fixed-length character type

CS_UNICHAR

unichar, univarchar

XML type

CS_XML_TYPE

Variable-length character type

CS_XML

xml

Datetime types

CS_DATE_TYPE

4-byte date datatype

CS_DATE

date

CS_TIME_TYPE

4-byte time datatype

CS_TIME

time

CS_DATETIME_TYPE

8-byte datetime type

CS_DATETIME

datetime

CS_DATETIME4_TYPE

4-byte datetime type

CS_DATETIME4

smalldatetime

Numeric types

CS_TINYINT_TYPE

1-byte integer type

CS_TINYINT

tinyint

CS_SMALLINT_TYPE

2-byte integer type

CS_SMALLINT

smallint

CS_INT_TYPE

4-byte integer type

CS_INT

int

CS_BIGINT_TYPE

8-byte integer type

CS_BIGINT

bigint

CS_USMALLINT_TYPE

Unsigned 2-byte integer type

CS_USMALLINT

usmallint

CS_UINT_TYPE

Unsigned 4-byte integer type

CS_UINT

uint

CS_UBIGINT_TYPE

Unsigned 8-byte integer type

CS_UBIGINT

ubigint

CS_DECIMAL_TYPE

Decimal type

CS_DECIMAL

decimal

CS_NUMERIC_TYPE

Numeric type

CS_NUMERIC

numeric

CS_FLOAT_TYPE

8-byte float type

CS_FLOAT

float

CS_REAL_TYPE

4-byte float type

CS_REAL

real

Money types

CS_MONEY_TYPE

8-byte money type

CS_MONEY

money

CS_MONEY4_TYPE

4-byte money type

CS_MONEY4

smallmoney

Text and image types

CS_TEXT_TYPE

Text type

CS_TEXT

text

CS_UNITEXT_TYPE

Unsigned variable-length character type

CS_UNITEXT

unitext

CS_IMAGE_TYPE

Image type

CS_IMAGE

image