FormatBatchQuery

(ODBC Manager Library)

Description: When given an array of SQL queries, this module will re-format them into a single query, suitable for a batch call to the specified database.
Returns: Text
Usage: Script Only.
Related to: AddConnection | BuildDelete | BuildInsert | BuildSelect | BuildUpdate | ConvertToDbDate | ConvertToDbTime | ConvertToDbTimeStamp | ConvertToVTSDate | ConvertToVTSTime | ConvertToVTSTimeStamp | CopyRecords | DBDropList | DBGridList | ErrMessage | ExecuteQuery | ExecuteQueryCachedFlushCache | GetConnList | ResultFormat | StatsWin | TableSynch | Transaction | TransactionCached
Format: \ODBCManager.FormatBatchQuery(  dbType,  QueryArray,  StartingElement,  NumberOfElements)
Parameters:  
dbType    
Required numeric value, indicating the type of this DB connection.
DBTypeMeaning
0MS SQL
1MS Access
2Oracle
3MySQL
4SyBase
QueryArray
Required. SQL queries to be executed in a batch.
StartingElement  
Required. Sets the element in the array at which to begin.
NumberOfElements
Required. Sets the number of elements of the array that should be processed.
Comments:

This module is a member of the ODBCManager Library, and must therefore be prefaced by \ODBCManager, as shown in "Format" above.
The return value is the batch query as a text string. If the database type is unknown, this function will return only one element from the array, as indicated by the StartingElement. Batch queries cannot be created without knowing which separator string to use.

The only way to ensure that a long running (or faulty) query does terminate is to set appropriate values for both the parameters ExecutionTimeout and UseDriverTimeout when running AddConnection. Modules executing queries are designed to be run as launched modules and will remain active until complete.