SQLExecDirect - cBaseSQLExecutor
Executes a SQL Query and returns a result set
Type: Function
Return Data Type: Variant
Parameters
| Parameter | Type | Description |
|---|---|---|
| sSQLQuery | String | SQL Query |
Syntax
Function SQLExecDirect String sSQLQuery Returns Variant
Call Example
Get SQLExecDirect sSQLQuery to VariantVariable
Description
Executes a SQL Query and returns a result set.
The result sets can be fetched into the following types: String, Variant, Struct, tWebRow, and tDataSourceRow. The destination array for String and Variant should be defined as a two-dimensional array and the array for Structs, tWebRow and tDataSourceRow should be defined as one dimensional array.
See cSQLExecutor for more information about result sets.
Sample
Example of a query with a result set.
String[][] aResults
// Fetch results into aResults
Get SQLExecDirect of ghoSQLExecutor @SQL"SELECT
Name,
City,
Zip
FROM Customer" to aResults
// Test for errors
If (not(Err)) Begin
// Process results here..
End
See Also
Return Value
Result set