Reads SQL statements from either a flat file or standard input, dynamically describes and prepares the statements, and returns an answer set. Supports concurrent connections to multiple databases. This tool is provided in the misc subdirectory of the instance sqllib directory.
Authorization
sysadm
Required Connection
None. This command establishes a database connection.
Command Syntax
>>-db2sql92---+-------------+--+----------------+--------------->
+--d--dbname--+ +--f--file_name--+
>--+--------------------+--+----------------------------+------->
+--a--userid/passwd--+ +--r--outfile-+----------+---+
+-outfile2-+
>--+-------------+--+------------------+--+--------------+------>
| +-on--+ | | +-short----+ | +--o--options--+
+--c--+-off-+-+ +--i--+-none-----+-+
+-long-----+
+-complete-+
>--+-------------+--+-------------+--+-----+-------------------><
| +-off-+ | | +-off-+ | +--h--+
+--v--+-on--+-+ +--s--+-on--+-+
|
Command Parameters
Identify comment text with two hyphens at the start of each line, that is, -- <comment>. If it is to be included in the output, mark the comment as follows: --#COMMENT <comment>.
A block is a number of SQL statements that are treated as one, that is, information is collected for all of those statements at once, instead of one at a time. Identify the beginning of a block of queries as follows: --#BGBLK. Identify the end of a block of queries as follows: --#EOBLK.
Specify one or more control options as follows: --#SET <control option> <value>. Valid control options are:
Usage Notes
The following can be executed from the db2sql92 command prompt:
This tool supports switching between different databases during a single execution of the program. To do this, issue a CONNECT RESET and then one of the following on the db2sql92 command prompt (stdin):
connect to database connect to database USER userid USING passwd
SQL statements can be up to 32 700 characters in length. Statements must be terminated by a semicolon.
SQL statements are executed with the repeatable read (RR) isolation level.
See Also