ct_get_format

Description

Returns the user-defined format for a result column.

NoteThis function is used with requests to Adaptive Server Enterprise only.

Syntax

CS_RETCODE cs_get_format (command, column_num,
                           buffer, buf_len, outlen);
CS_COMMAND   *command;
CS_INT       column_num;
CS_BYTE      *buffer;
CS_INT       buf_len;
CS_INT       *outlen;

Parameters

command

(I) Handle for this client/server operation. This handle is defined in the associated ct_cmd_alloc call.

column_num

(I) Number of the column for which the user-specified format is desired.

column_num refers to the select-list ID of the column. The first column in the select list of a select statement is column number 1, the second is column number 2, and so forth.

buffer

(O) Variable (“buffer”) in which ct_get_format places the requested information.

This argument is typically:

	char buffer[n];
buf_len

(I) Length, in bytes, of the buffer.

If buf_len is too small to hold the requested information, ct_get_format sets outlen to the length of the requested information, and returns CS_FAIL.

outlen

(O) Length, in bytes, of the format string. outlen is an integer variable where ct_get_format returns the total number of bytes being retrieved.

When the format string is larger than buf_len bytes, an application uses this value to determine how many bytes are needed to hold the string.

If no format string is associated with the specified column, ct_get_format sets outlen to 0.

Returns

ct_get_format returns one of the following values:

Value

Meaning

CS_SUCCEED (-1)

The routine completed successfully.

CS_FAIL (-2)

The routine failed.

TDS_INVALID_PARAMETER(-4)

One of ct_get_format arguments contains an illegal value.

Usage

See also

Related functions