Returns the user-defined format for a result column.
This function is used with requests to Adaptive Server Enterprise only.
%INCLUDE CTPUBLIC;
DCL 01 COMMAND FIXED BIN(31) INIT(0); 01 RETCODE FIXED BIN(31) INIT(0); 01 COLUMN_NUM FIXED BIN(31) INIT(1); 01 BUFFER FIXED BIN(31); 01 BUFFER_LEN FIXED BIN(31); 01 OUTLEN FIXED BIN(31); CALL CTBGETFO (COMMAND, RETCODE, COLUMN_NUM, BUFFER, BUFFER_LEN, OUTLEN);
(I) Handle for this client/server operation. This handle is defined in the associated CTBCMDALLOC call.
(O) Variable where the result from an executed function returns. Its value is one of the codes listed under “Returns,” in this section.
(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.
(O) Variable (“buffer”) in which CTBGETFORMAT places the requested information.
This argument is typically:
01 BUFFER CHAR(n);
(I) Length, in bytes, of the buffer.
If BUFFER_LEN is too small to hold the requested information, CTBGETFORMAT sets OUTLEN to the length of the requested information, and returns CS_FAIL.
(O) Length, in bytes, of the format string. OUTLEN is an integer variable where CTBGETFORMAT returns the total number of bytes being retrieved.
When the format string is larger than BUFFER_LEN bytes, an application uses this value to determine how many bytes are needed to hold the string.
If a format string is not associated with the specified column, CTBGETFORMAT sets OUTLEN to 0.
CTBGETFORMAT 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 the CTBGETFORMAT arguments contains an illegal value. |
CTBGETFORMAT returns the user-defined format, if any, for a result column. It indicates how the field should be formatted on screen.
An application can call CTBGETFORMAT after CTBRESULTS indicates results of type CS_ROW_RESULT.
For a description of how to add user-defined formats to Adaptive Server databases or Open Servers, see the Adaptive Server and Open Server documentation.
Related functions: