Calling convention: CIP_SQLMatrix("DBName": String, "SQLStatement": String, [OutRowCount: Integer], [OutFieldCount: Integer]): VarArray
Description: Executes a query and returns its complete result as a two-dimensional Variant array indexed as [column,row]. Named SQL parameters are resolved from the same runtime sources as CIP_SQL.
Parameters:
DBName: connection name; an empty string selects the current connection.
SQLStatement: SELECT statement to execute.
OutRowCount: optional output variable receiving the record count; receives 0 for an empty result set.
OutFieldCount: optional output variable receiving the field count; receives 0 for an empty result set.
Returns: VarArray: query values indexed by column and row; an empty two-dimensional array when the result set is empty. NULL is returned when no usable query can be created.
Availability: Default; the selected connection must be visible to the current user.
Example:
ResultArr := CIP_SQLMatrix("", "SELECT * FROM OEE_USER", RowCount, FieldCount);
CIP_ShowMatrix(ResultArr, "Users", "", False, "");