Executing commands

Use the Script page of the Command Center notebook to execute one or more DB2 commands or SQL statements.

Fields and controls

Authorities and privileges



To execute one or more commands:

  1. Open the Command Center notebook

  2. If you want to execute a single command:

    1. Click on the Interactive radio button on the Script page.

    2. In the entry field, type the DB2 command or the SQL statement that you want to execute (terminated by a semicolon), or select a previously executed command or statement from the command history list.
      Note:You can execute multiple commands in interactive mode. Each command or statement (except the last) must be terminated by a semicolon.

    3. Select Script->Execute from the menu selections, or click on the icon to execute the command or statement.

  3. If you want to run several commands in sequence:

    1. Click on the Script radio button on the Script page.

    2. In the entry field, type the DB2 commands or the SQL statements that you want to execute (terminated by semicolons), or select a previously executed command file from the command history list.
      Note:The default statement termination character is the carriage return. You can, however, select the Use statement termination character check box on the General page of the Tools Settings notebook, and specify a different termination character. If you select this check box and do not specify a termination character, the default termination character is the semicolon. This option is not valid for the interactive mode. Termination characters are valid only for DB2 scripts.

    3. Select Script->Execute from the menu selections, or click on the icon to execute the commands or statements in sequence.
      Note:If you want to execute a single command, rather than all the commands or statements in sequence, highlight the command that you want, and then select Script->Execute from the menu selections, or click on the icon.

To terminate a running command, statement, or script in progress, select Results->Terminate from the menu selections, or click on the icon.

Related information