You can use the command line processor to enter SQL statements, DB2 commands, and operating system commands. It operates in the following modes:
To invoke the command line processor in interactive input mode, do the following:
You can also invoke the command line processor in interactive input mode by entering the db2cmd command followed by the db2 command at a command prompt. In interactive input mode, the prompt looks like this:
db2 =>
In interactive mode, you do not have to enter DB2 commands with a db2 prefix; instead, you just enter the DB2 command. For example:
db2 => list node directory
To enter operating system commands in interactive mode, precede the operating-system command with an exclamation mark (!). For example:
db2 => !dir
![]() |
Windows 3.x does not support this method of running operating system
commands.
|
If you need to enter a long command that does not fit on one line, use the line continuation character, \. For example:
db2 => select empno, lastname, birthdate, from \ db2 (cont.) => employee where sex='F' order by empno desc
| Note: | You do not need to use a line continuation character when entering long commands in interactive input mode on Windows 3.x workstations. |
To end interactive input mode, enter the quit command.
For more information on advanced topics using the command line processor, refer the Command Reference.
On UNIX, you can enter DB2 commands from a command prompt. You must include the db2 prefix. For example:
db2 list node directory
To invoke the command line processor in command line mode on Windows 32-bit operating systems, use one of the following methods:
After you invoke the DB2 command environment, you can enter DB2 commands at the command prompt. You must include the db2 prefix.
Notes:
db2 "select * from employee"
For more information on using the command line processor, refer to the Command Reference.