f2s_esql_column_count

Applies to: Oracle, MS SQL, MySql/MariaDB, PostgreSQL Drivers

Syntax

f2s_esql_column_count {variable} [using {variant}]

Parameter

Description

variable

The returned value.

variant

Optional variant type variable that will receive a statement interface.

Description

This command is used to get the number of columns in a SQL table. The optional “using” syntax allows you to pass around the interface created by this command. The variable passed MUST be a variant. This allows for multiple statements to be active concurrently in some cases. If you use the “using” syntax, it must be used on all subsequent commands. Mixing the using syntax is not supported. So for instance, if you plan on having multiple statements active concurrently, all active statements must make use of the using syntax.

Example

f2s_esql_column_count Command
 String sColumnName sColumnType
 Integer i iNumofColumns
 Variant[] vRow
     f2s_esql_create_stmt "select * from customer"
     f2s_esql_prepare_stmt
     f2s_esql_execute_stmt
     f2s_esql_get_row vRow
     f2s_esql_column_count iNumofColumns
     For i from 1 to iNumofColumns
         f2s_esql_column_attribute f2s_attrib_name of i to sColumnName
         f2s_esql_column_attribute f2s_attrib_type of i to sColumnType
         Showln ("Column Name: " + sColumnName + " Type: " + sColumnType + " Value= " + String(vRow[i - 1]))
     Loop
     f2s_esql_close_stmt
     inkey WindowIndex

Replaces: Command SQL_GET_NUM_COLS