Using the stored procedure debug launch configuration

A launch configuration is a mechanism for defining and saving different workbench configurations that can be launched separately. You can use launch configurations for launching debug sessions.

You can create a launch configuration for launching a stored procedure debug session or, when you choose the Data Project Explorer view Debug action for a stored procedure, a launch configuration is created for you. In either case, follow these steps which go over launch configuration tabs in detail:

  1. If you are creating a new launch configuration without using the Data Project Explorer view Debug action , go to a workbench perspective that offers the launch/debug/run action set (such as the Debug perspective) and perform one of the following tasks:
    • Select Run > Debug from the workbench menu bar to open the Debug launch configurations dialog box.
    • Click the down arrow next to the workbench toolbar Debug push button and choose Debug from the list. This will open the Debug launch configurations dialog box.

    If you are using the Data Project Explorer view Debug action, the launch configuration will be created for you and you can skip this and the next step.

  2. In the Debug launch configurations dialog box, perform one of the following tasks:
    • Select the DB2 Stored Procedure node and click New.
    • Right-click the DB2 Stored Procedure node and select New from the pop-up menu.
    • Double-click the DB2 Stored Procedure node.
  3. In the Name field, enter a name of your choice for the configuration that you are creating.
  4. Select the Main tab to bring it to the foreground.
  5. In the Project field, indicate the workbench project that is associated with the stored procedure that you want to debug. To do this, click Browse and, in the resulting Project name dialog box, select the project to use and click OK.
  6. The URL of the database (according to the JDBC) will automatically display in the Location (URL) field. This field is read-only.
  7. To specify the procedure that you want to debug, click the Procedure field Browse button to invoke the procedure selection dialog box. The procedure must be in the previously-specified project in your workspace.
  8. In the procedure selection dialog box, choose the procedure that you want to debug and click OK to return to the launch configuration page.
  9. After you select the procedure, the Procedure field fills in with the procedure name. Completion of this field is mandatory.
  10. Arguments that you want to pass to the procedure for the debug session are specified in the argument list. Initially, the argument list defaults to values that are appropriate for the argument type or, if these values were changed in the Run Settings dialog box, the list defaults to the changed values. When you run a launch configuration for a stored procedure that can take parameters, a Specify Parameter Values dialog box opens automatically at launch time. You can use this dialog box to add or edit arguments to pass to the stored procedure. Alternatively, you can click the Argument list field Edit button to invoke the Run Settings dialog box, which will allow you to edit arguments and other run settings. This button is greyed out and cannot be accessed if the procedure has no parameters.
  11. The Run Settings dialog box contains a variety of settings for running stored procedures. In the dialog box, select the Parameter Values tab to access parameters that are available for the selected procedure (the settings in this tab are the same that are found in the Specify Parameter Values dialog box). For each parameter, the following items are listed:
    • argument name
    • type (character, integer, etc.)
    If the parameter is input or input/output, then the value cell for the argument field is enabled and you can edit the value in the field, specifying an integer or character value, etc., depending on the type. When you have finished editing the parameter values, click OK to return to the launch configuration page.
  12. To set the Source Lookup Path, select the Source tab and perform any of these tasks:
    • To add a source location, click Add. This will invoke the Add Source dialog box, in which you can select the type of source location to add. From the selection list in the Add Source dialog box, choosing Workspace will cause all projects in your workspace to be added to the source search path. All other selections will result in a dialog box in which you can enter or browse for the source search path location that you want to use.
    • To remove an existing entry, select a source location and click Remove.
    • To set the order of existing entries, select a source location and click Up or Down to alter that location's placement.
      Note: In some cases, changing the placement of a location might not take effect until the next time the stored procedure is launched.

    If you want to search for all instances of the source file name in the source search path, select the Search for duplicate source files on the path check box. If you select this check box and the debugger finds multiple instances of the file name, you will be prompted by a dialog box to choose the correct source file.

  13. Select the Common tab to bring it to the foreground. You can perform these tasks in the Common page:
    • If you want the launch configuration to be stored locally and available for a single user, ensure that the Local file radio button is selected. If the launch configuration is to be stored as a file in the workspace and shared in a repository for team use, select the Shared file radio button and enter a location to save the launch configuration in. Alternatively, you can browse for the location.
    • If you want the launch configuration to be displayed as a favorite debug configuration in the Debug push button favorites menu or the Debug menu Debug History list, select the Debug check box.
    • In the Console Encoding section, indicate the character encoding that you want the Console view to use. For example, if you want the view to display a language other than English, you may want to change the encoding.
    • In the Standard Input and Output section, you indicate the location of the Console view input and output.
    • To run the launch configuration in the background, select the Launch in background check box.
  14. If all information mandatory to the launch configuration has been provided, the Debug push button will be enabled. If you change any settings in a saved launch configuration (or in a launch configuration that has been created automatically when you select Debug in the Data Project Explorer view), the Apply push button will be enabled. Clicking Apply will save the launch configuration, at which point you can choose to close the dialog box without launching the debug session or you can click Debug to launch a debug session using the new launch configuration. If you click Debug, any changes to the launch configuration will be saved and a debug session will be launched.

    After you have saved a debug launch configuration, you can edit it. For further information about editing debug launch configurations, see the related task.

    Tip: If you have not yet saved launch configuration settings and if you have made entries in the launch configuration settings that you want to remove or change, clicking Revert will remove all changes that you have made.
  15. If information mandatory to the launch configuration has not been provided or if there are errors in the information that you have provided, messages at the top of the dialog box will indicate what is missing.
  16. When you are finished working in the dialog box, click Close to exit it without launching a debug session.
Related concepts
Local and remote debugging
Related tasks
Starting a debug session
Preparing to debug
Creating new launch configurations from existing launch configurations
Editing launch configurations
Removing launch configurations

Feedback