IBM Books

Administration Guide


Syntax for dynexpln

Figure 72. Syntax for dynexpln

* Figure SQLD0DEX not displayed.


The table below summarizes the option-flags and option-parameters that may be used with the dynexpln command. You can specify these options in any sequence and combination.

Table 100. dynexpln Command Options
Option Flag Option Parameter Description
-d database name The name of the database to use when explaining statements.

If you do not specify this option you will be prompted to provide it.

-e statement terminator The character used to indicate that the end of an SQL statement has been reached.

The default is that there is no statement terminator. If you use this option, dynexpln will use the specified termination character to separate the statements. If you do not use this option, each line of the file will be assumed to be a separate SQL statement.

-f input file The name of the file which contains the SQL statements to be explained.

Unless you use the statement terminator (-e) option, only one SQL statement should appear on each line of the file. SQL comments may be entered into the file. An SQL comment starts with -- and goes to the end of the line.

-h or -? (none) Obtain help information about the input parameters. Specifying this option overrides all other options.
-i (none) Display operator IDs in the explained plan. The operator IDs allow the output from dynexpln to be matched to the output from the Explain facility.
-o output file The name of the file to which dynexpln will write the results.
-s SQL statement The SQL statement to be explained.

If you do not specify this option and you do not specify the input file (-f) optional parameter, you will be prompted to provide the SQL statement to be explained.

If you specify both this option and the input file (-f) optional parameter, dynexpln will first describe the statements provided by the SQL statement (-s) option and then describe the statements in the input file (-f).

-t (none) The output is directed to the terminal.

If both the output (-o) and -t options are specified, then the output is directed to the terminal.

If you do not specify the output file (-o) or -t options, you will be prompted for a file name, with the default displaying the output at the terminal.

-u user id and password When connecting to the database, use the provided user id and password.

Both the user id and password must be valid according to naming conventions and be recognized by the database.

Some of the option flags in the above table may have special meaning to your Operating System and, as a result, may not be interpreted correctly in the dynexpln command line. However, it may be possible to enter these characters by preceding them with an escape character. For more information, see your Operating System user's manual.

If you use the statement terminator (-e) option, you may enter multiple statements using the SQL statement (-s) option. If you do this, you should separate the statements with the termination character.

Help and initial status messages, produced by dynexpln, are written to standard output. All prompts and other status messages produced by the explain tool are written to standard error. Explain text is written to standard output or to a file depending on the output option chosen.

For example, to connect to a database named SAMPLE and explain all the statements in the file TRYIT, with the results being written to the file my.exp, enter

    dynexpln -d SAMPLE -f TRYIT -o my.exp


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]