3.9 CS_DATAFMT Objects

CS_DATAFMT objects are a very thing wrapper around the Sybase CS_DATAFMT structure. They have the following attributes:

attribute type
name string
datatype int
format int
maxlength int
scale int
precision int
status int
count int
usertype int
strip int

The strip attribute is an extension of the Sybase CS_DATAFMT structure. Please refer to the DataBuf documentation.

CS_DATAFMT structures are mostly used to create DataBuf objects for sending data to and receiving data from the server.

A CS_DATAFMT object created via the CS_DATAFMT() constructor will have the following values:

attribute value
name '$\backslash$0'
datatype CS_CHAR_TYPE
maxlength 1
scale 0
precision 0
status 0
count 0
usertype 0
strip 0

You will almost certainly need to provide new values for some of the attributes before you use the object.

A CS_DATAFMT object created as a return value from the ct_bind() function will be ready to use for creating a DataBuf object.