%XSQL.StatementBatchhidden class %XSQL.StatementBatch
A statement batch is a stream of TSQL source statements. A %XSQL.StatementBatch instance can be executed dynamically and the results displayed on the current device and optionally written to a log device. Statement Batches are typically retrieved from an external file that may contain one or more batches, each terminated by a 'go' statement or by the end of file. This class does not manage multiple batches. That is the responsiblity of the caller. The inputStream property is expected to be a %Stream.Object that contains TSQL source that is executed as a single procedure.
dialect identifies which TSQL implementation to emulate. Most behavior is consistent but there are minor differences.
The number of errors encountered during execution.
errorPause is the number of seconds to pause when an error is encountered. Not all errors will pause.
A stream containing all errors encountered during execution.
executeCount is the number of statement groups that were executed while processing the current statementBatch instance.
TSQL source input stream.
lineCount is the number of lines read from the inputStream
The reference to the %TSQL.sys.log object. The log object has a file property and all log output is directed to that file.
Use this property to set the SQL runtime mode for any SQL statements executed. Setting the runtime mode for this StatementBatch does not permanently change the $zu(115,5) value. Possible values are:
- 0 for LOGICAL mode.
- 1 for ODBC mode.
- 2 for DISPLAY mode.
- "" to use the process wide $zu(115,5) value.
settings is the array of runtime options that can be specified by the caller or by configuration.
CREATE PROCEDURE batch processing. This method creates a class method in a class that projects an SQL procedure. The implementation is the body of the CREATE PROC statement batch.
CREATE TRIGGER batch processing. This method creates a trigger in a class that corresponds to the specified table. The implementation is the body of the CREATE TRIGGER statement batch.
execute() Internal use only. This method prepares and executes a batch of dynamic TSQL statements contained in a stream.