IBM Books

Command Reference

Command Line Processor Invocation

The db2 command starts the command line processor. The CLP is used to execute database utilities, SQL statements and online help. It offers a variety of command options, and can be started in:

Note:On Windows NT, db2cmd - Open DB2 Command Window opens the CLP-enabled DB2 window, and initializes the DB2 command line environment. Issuing this command is equivalent to clicking on the DB2 Command Window icon.

QUIT stops the command line processor. TERMINATE also stops the command line processor, but removes the associated back-end process and frees any memory that is being used. TERMINATE is recommended if the database has been stopped, or if database configuration parameters have been changed.
Note:Existing connections should be reset before terminating the CLP.

The shell command (!), allows operating system commands to be executed from the interactive or the batch mode on UNIX based systems, and on OS/2 or the Windows operating system (!ls on UNIX, and !dir on OS/2 or the Windows operating system, for example).
Note:Shell command support is not available on Windows 3.1.

Authorization

None

Command Syntax

>>-db2----+------------------------------------------------+---><
          |  .-------------------.                         |
          |  V                   |                         |
          +----+--------------+--+---+-------------------+-+
          |    '-option-flag--'      +-db2-command-------+ |
          |                          +-sql-statement-----+ |
          |                          '-?--+------------+-' |
          |                               +-phrase-----+   |
          |                               +-message----+   |
          |                               +-sqlstate---+   |
          |                               '-class-code-'   |
          '-----comment------------------------------------'
 

Command Parameters

option-flag
For a summary of valid CLP option flags, see Table 1.

db2-command
Specifies a DB2 command. For a description of DB2 commands, see Chapter 3. CLP Commands.

sql-statement
Specifies an SQL statement.

?
Requests CLP general help.

? phrase
Requests the help text associated with a specified command or topic. If the database manager cannot find the requested information, it displays the general help screen.

? options requests a description and the current settings of the CLP options. ? help requests information about reading the online help syntax diagrams.

? message
Requests help for a message specified by a valid SQLCODE (? sql10007n, for example).

? sqlstate
Requests help for a message specified by a valid SQLSTATE.

? class-code
Requests help for a message specified by a valid class-code.

-- comment
Input that begins with the comment characters -- is treated as a comment by the command line processor.
Note:In each case, a blank space must separate the question mark (?) from the variable name.


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

[ DB2 List of Books | Search the DB2 Books ]