CS_DATAFMT structure

A CS_DATAFMT structure is used to describe data values and program variables. For example:

Most routines use only a subset of the fields in a CS_DATAFMT. For example, srv_bind does not use the name and usertype fields, and srv_descfmt does not use the format field. For information on which fields in the CS_DATAFMT a routine uses, see that routine’s reference page.

A CS_DATAFMT structure is defined as follows:

typedef struct _cs_datafmt
{
     CS_CHAR       name[CS_MAX_NAME];   /* Name of data.       */
      CS_INT        namelen;             /* Length of name.     */
      CS_INT        datatype;            /* Datatype of data.   */
      CS_INT        format;              /* Format symbols.     */
      CS_INT        maxlength;           /* Max length of data. */
      CS_INT        scale;               /* Scale of data.      */
      CS_INT        precision;           /* Precision of data.  */
      CS_INT        status;              /* Status symbols.     */
 
    /*
       ** The following field is not used in Open Server.
       ** It must be set to 1 or 0.
       */
       CS_INT     count;                 
     /*
       ** These fields are used to support user-defined
       ** datatypes and international datatypes:
       */
       CS_INT    usertype;            /* User-defined type.*/
       CS_LOCALE *locale;             /* Locale information. */
} CS_DATAFMT;

where: