Running a command from Scratchpad


Use the following procedure to run one or more commands directly from the Scratchpad perspective. If Scratchpad is displaying multiple commands, you can run all of them, or select and run a single command.

QuickCourseArrow.png

For more information, view the Quick Course Workbench for DB2 - Executing DB2 Commands.

To run a command

New BMC Workbench console
  1. Enter the command or commands into Scratchpad.The source can be either:
    • A command that you pasted or typed into Scratchpad and then edited.
    • A command that you generated from DB2 objects.
  2. Perform one of the following tasks:
    • To run one command from a group displayed in Scratchpad, select the command and click Run Selected NW_run_selected.png.
    • To run all commands displayed in Scratchpad, click Run NW_run.png.

      Warning

      Note

      Any existing output is discarded when you run the commands again.

  3. Select the DB2 subsystem on which to run the command. Guidelines are as follows:

    • By default, the last-executed DB2 connection is pre-selected.
    • Type the full or partial name of a DB2 connection to select the first subsystem that matches this value in the list of favorite connections.
    • Use the menu arrow to select from your list of favorite connections.
    Success

    Tip

    Click NW_plug_connect_square_green.png and specify which DB2 connections to include in your list of favorite connections.

    The status bar at the bottom of the screen indicates whether the command runs successfully. The Output tab displays a summary for each command that you ran.

  4. To view results, perform one of the following tasks:

    • To view all results, click View All Result Sets NW_table.png .
    • To view the result set for a specific command, on the Output tab, click the relevant View result set.
    Success

    Tip

    If the command failed to run successfully, click View Messages NW_envelope_o_circle.png to see all error messages, or click NW_envelope_o_circle.png on the Output tab to view error messages for a specific command.Also, note that View All Result Sets and View Output Text are enabled only when the Output tab is active.

  5. Save the results as a text file on your local file system:
    1. Click the Output tab and in the tool bar, then click View Output Text NW_file_text_o.png in the tool bar.
    2. Click NW_floppy.png.
Classic BMC Workbench console


  1. Enter the command or commands into Scratchpad.The source can be either:
    • A command that you pasted or typed into Scratchpad and then edited.
    • A command that you generated from DB2 objects.
  2. Perform one of the following tasks:
    • To run one command from a group displayed in Scratchpad, select the command and click Run Selected ExecuteSelected-24.png.
    • To run all commands displayed in Scratchpad, click Run execute-24.png.

      Warning

      Note

      Any existing output is discarded when you run the commands again.

  3. Select the DB2 subsystem on which to run the command. Guidelines are as follows:

    • By default, the last-executed DB2 connection is pre-selected.
    • Type the full or partial name of a DB2 connection to select the first subsystem that matches this value in the list of favorite connections.
    • Use the menu arrow to select from your list of favorite connections.
    Success

    Tip

    Click ViewFavoritesList-24.png and specify which DB2 connections to include in your list of favorite connections.

    The status bar at the bottom of the screen indicates whether the command runs successfully. The Output tab displays a summary for each command that you ran.

  4. To view results, perform one of the following tasks:

    • To view all results, click View All Result Sets g_gud__AllResultSets.png .
    • To view the result set for a specific command, on the Output tab, click the relevant View Result Set.
    Success

    Tip

    If the command failed to run successfully, click View Messages MessageManager-24.png to see all error messages, or click MessageManager-24.png on the Output tab to view error messages for a specific command.Also, note that View All Result Sets and View Output Text are enabled only when the Output tab is active.

  5. Save the results as a text file on your local file system:
    1. Click the Output tab and in the tool bar, then click View Output Text report-24.png in the tool bar.
    2. Click SaveAs-24.png.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC Workbench for DB2 12.1