Open ClientConnect datatypes are designed to match the corresponding DB2 datatypes. For example, CS-VARCHAR is the same as the DB2 datatype VARCHAR, which is different from the Adaptive Server varchar type.
Open ClientConnect supports the following three binary types:
CS-BINARY is a binary type.
CS-VARBINARY is a variable-length binary type. It corresponds to the DB2 datatype VARBINARY, the DB-Library datatype DBVARYBIN, and the Gateway-Library datatype TDSVARYBIN, and includes a length specification (the initial two bytes, referred to in print as “LL”) along with the data.
CS-LONGBINARY is a long variable binary type. It does not include the two-byte “LL” length specification prefix. The default maximum length for this datatype is 32K.
CS-VARBINARY does not correspond
to the Adaptive Server datatype varbinary. Open ClientConnect converts
Adaptive Server varbinary data to CS-VARBINARY.
Open ClientConnect supports the following three character types:
CS-CHAR is a set-length character type.
CS-VARCHAR is a variable-length character type. It corresponds to the DB2 datatype VARCHAR, the DB-Library datatype DBVARYCHAR, and the Gateway-Library datatype TDSVARYCHAR, and includes a length specification (the initial two bytes, referred to in print as “LL”) along with the data.
CS-LONGCHAR is a long variable-length character type. It does not include the two-byte “LL” length specification prefix.
CS-VARCHAR does not correspond
to the Adaptive Server datatype varchar. Open ClientConnect converts
Adaptive Server varchar data to CS-VARCHAR.
Open ClientConnect supports the following two datetime types that hold 8-byte and 4-byte datetime values, respectively:
CS_DATETIME corresponds to the Adaptive Server datatype datetime. The range of legal CS_DATETIME values is from January 1, 1753 to December 31, 9999, with a precision of 1/300th of a second (3.33 milliseconds).
CS_DATETIME4 corresponds to the Adaptive Server datatype smalldatetime. The range of legal CS-DATETIME4 values is from January 1, 1900 to June 6, 2079, with a precision of 1 minute.
Open ClientConnect supports the following two integer types:
CS-SMALLINT is a 2-byte integer.
CS-INT is a 4-byte integer.
Open ClientConnect supports the following five decimal types:
CS-REAL is a 4-byte decimal value.
CS-FLOAT is an 8-byte decimal value.
CS-PACKED370 is used to handle IBM S/370 packed decimal data. It can be converted to the Adaptive Server money, char, numeric, or Sybase-decimal datatype with CSBCONVERT.
CS-PACKED370 values can be negative. The maximum number of decimal places for a packed decimal object is 31.
CS-NUMERIC is used to handle Adaptive Server numeric data. It can be converted to character or packed decimal.
01 NUMDEC 05 Precision CHAR(1) 05 Scale CHAR(1) 05 ARR CHAR(33)
CS-DECIMAL is used to handle Adaptive Server numeric data. It can be converted to character or packed decimal. It is defined the same way as CS-NUMERIC.
Open ClientConnect supports the following two money datatypes that hold 8-byte and 4-byte money values, respectively:
CS-MONEY corresponds to the Adaptive Server datatype money. The range of legal CS-MONEY values is +/- $922,337,203,685,477.5807.
CS-MONEY4 corresponds to the Adaptive Server datatype smallmoney. The range of legal CS-MONEY4 values is between -$214,748.3648 and +$214,748.3647.