ct_getformat

Description

Return the server user-defined format string associated with a result column.

Syntax

CS_RETCODE ct_getformat (cmd, colnum, buffer, buflen,
               outlen)
CS_COMMAND       *cmd;
 CS_INT                   colnum;
 CS_VOID                *buffer;
 CS_INT                   buflen;
 CS_INT                   *outlen;

Parameters

cmd

A pointer to the CS_COMMAND structure managing a client/server operation.

colnum

The number of the column whose user-defined format is desired. The first column in a select list is column number 1, the second is number 2, and so forth.

buffer

A pointer to the space in which ct_getformat will place a null-terminated format string.

buflen

The length, in bytes, of the *buffer data space.

outlen

A pointer to an integer variable.

If outlen is supplied, ct_getformat sets *outlen to the length, in bytes, of the format string. This length includes the null terminator.

If the format string is larger than buflen bytes, an application can use the value of *outlen to determine how many bytes are needed to hold the string.

If no format string is associated with the column identified by colnum, ct_getformat sets *outlen to 1 (for the null terminator).

Returns

ct_getformat returns the following values:

Return value

Meaning

CS_SUCCEED

The routine completed successfully.

CS_FAIL

The routine failed.

CS_BUSY

An asynchronous operation is already pending for this connection. See “Asynchronous programming”.

Usage

See also

ct_bind, ct_describe