SQLColumnInfo - cBaseSQLExecutor

Returns the column information for the result set

Type: Function

Return Data Type: tSQLColumnInfo[]

Parameters: None

Return Value

Column information for the result set


Syntax
Function SQLColumnInfo Returns tSQLColumnInfo[]

Call: Get SQLColumnInfo to tSQLColumnInfoArrayVariable


Description

SQLColumnInfo returns the column information for the result set into a array of tSQLColumnInfo structs.

Types reported are based on the data types returned by ODBC and might be slightly different than the actual data type in the table structure in the backend.

If you want to put the results into a grid, the column information, for example, can be used to initialize your grid columns. Always call SQLColumnInfo after a SQLExecute or SQLExecDirect.

Example

This query will result in a aColumnsInfo array with 3 elements holding the information for the columns Name, City and Zip.

String[][] aResults
tSQLColumnInfo[] aSQLColumnsInfo

// Fetch results into aResults
Get SQLExecDirect of ghoSQLExecutor @SQL"SELECT
    Name,  
    City,
    Zip
    FROM Customer" to aResults

// Test for errors
If (not(Err)) Begin
    // Get the columns info
    Get SQLColumnInfo of ghoSQLExecutor to aSQLColumnsInfo

    // Process results here..
End