SQL_GET_COL_NAME¶

Applies to: ORAFlex SQLFlex MYSQLFlex PGFlex DB2Flex

This command is used to retrieve the name of a specified column within an SQL result set. An optional second variable can be used to retrieve the size of the specified column. Note that this command cannot be used when the results are being directly binded to the record buffer, it can only be used for the results of an SQL statement.

Syntax

SQL_GET_COL_NAME {columnNumber} to {variable} [{length}]

Parameter

Description

columnNumber

The column number being used

variable

String variable for the column name

length

Variable to hold the column length (optional)

Example

Open Customer

String sColumnName
Integer iLength

SQL_SET_STMT to "SELECT * FROM CUSTOMER WHERE STATUS = 'Active'"
SQL_PREPARE_STMT
SQL_EXECUTE_STMT
SQL_GET_COL_NAME 1 to sColumnName iLength
showln sColumnName
showln iLength