You can use the command line processor to enter SQL statements and DB2 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 following command at a command prompt:
In interactive input mode, the prompt looks like this:
db2 =>
This prompt indicates that you do not type DB2 commands with a db2 prefix; instead, you just type the DB2 command. For example:
list node directory
To run operating system commands in interactive mode, precede the operating-system command with an exclamation mark (!). For example:
!dir db2*.log
Note: | Windows 3.1x 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 firstname, lastname, dateofbirth, from \ db2 (cont.) => staff where height=123, order by \ db2 (cont.) => lastname
Note: | You do not need to use a line continuation character when entering long commands in interactive input mode on Windows 3.1 workstations. |
To end interactive input mode, type terminate.
On OS/2 and UNIX, you can issue 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 95 and Windows NT 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 further information on using the command line processor, refer to the Command Reference. |