BuildSelect

(ODBC Manager Library)

Description: Builds SQL selection queries using supplied field names and values. Made to be called as a subroutine only.
Returns: Text (the SQL query)
Usage: Script Only.
Related to: AddConnection | BuildDelete | BuildInsert | BuildUpdate | ConvertToDbDate | ConvertToDbTime | ConvertToDbTimeStamp | ConvertToVTSDate | ConvertToVTSTime | ConvertToVTSTimeStamp | CopyRecords | DBDropList | DBGridList | ErrMessage | ExecuteQuery | ExecuteQueryCachedFlushCache | FormatBatchQuery | GetConnList | ResultFormat | StatsWin | TableSynch | Transaction | TransactionCached
Format: \ODBCManager\BuildSelect( SelectFields,  TableName,  WhereFields,  WhereOperators,  WhereValues,  WhereSQLDataTypes,  WhereAND,  OrderFields,  Qualifier)
Parameters:  
SelectFields
Required. Text array of field Names to read
TableName
Required. May be a simple value or a one-dimensional array. The name(s) of the table(s) that will be queried.
WhereFields
Required. May be a simple value or a one-dimensional array. Field names for WHERE clause
WhereOperators
Required. May be a simple value or a one-dimensional array. Operators for WHERE clause
WhereValues
Required. Any SQL data type. May be a simple value or a one-dimensional array. Values for WHERE clause
WhereSQLDataTypes
Required. Values indicating the data type of the insert values. Should be a simple value or an array matching the WhereFields parameter.

Refer to Data Type Codes used in the ODBC Manager for a list of the codes.
WhereAND
Required. Can be any expression that evaluates to a Boolean true or false.
If set to true (non-zero) then the components of the WHERE clauses are to be ANDed together.
If false (0) an OR is used between the sub clauses.
OrderFields
Required. May be a simple value or a one-dimensional array. Provides the field names for ORDER BY clause
Qualifier
Required. SQL Qualifier such as "top 100", "unique", etc

Comments:

This module is a member of the ODBCManager Library, and must therefore be prefaced by \ODBCManager\, as shown in "Format" above.