SQL_GET_NUM_COLS¶

Applies to: ORAFlex SQLFlex MYSQLFlex PGFlex DB2Flex

This command is used to get the number of columns retrieved from an SQL expression result set. Since the column number is based on the result set, this command cannot be used when the results are being bound to the record buffer. If this command is used with the record buffer or if no columns are found, -1 is returned.

Syntax

SQL_GET_NUM_COLS to {variable}

Parameter

Description

variable

Variable to hold the number of columns.

Example

SQL_SET_STMT to "SELECT * FROM CUSTOMER WHERE FIRSTNAME = 'Aaron'"
SQL_PREPARE_STMT
SQL_EXECUTE_STMT
GET_RESULT_SET_NUM_COLS to iNumCols
Showln iNumCols