IBM Books

Administration Guide

dynexpln Syntax and Parameters

              '--d--database name--'
   '--e--statement terminator--'  '--f--input file--'  '--g--'
   +--h-+ +--i-----------------+ '--u--user ID password--'
   '--?-' +--o--output file----+
          +--s--SQL statement--+
          | .--t-.             |


-d database name
The name of the database that contains the packages to be explained.

If you do not specify this option, you will be prompted for 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.

Show optimizer plan graphs. Each section is examined, and the original optimizer plan graph (as presented by Visual Explain) is constructed. Note that the generated graph may not match the original plan.
-h or -?
Obtain help information about the input parameters. Specifying this option overrides all other options.
Display operator IDs in the explained plan. The operator IDs allow the output from db2expln to be matched to the output from the Explain facility.
-o output file
The name of the file to which db2expln 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).

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 password
When connecting to a 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 above 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 ]