Exercise 1.5: Running the stored procedure

Before you begin, you must complete Exercise 1.3: Creating and building an SQL stored procedure.

You can run the stored procedure for testing purposes. When you run the stored procedure, you can determine whether the run is successful and whether the result set exists. Running the stored procedure also helps you to test the logic of the routine and the accuracy of output arguments and result sets. When you run a stored procedure from the workbench, the workbench calls the stored procedure and the results are displayed in the DB Output view.

To run the SPEmployee stored procedure.

  1. In the Data Definition view, right-click the stored procedure, and select Run. The Run Settings window opens.
  2. In the Value field, type D11.

    D11 is the ID for a department (EMPLOYEE.WORKDEPT) in the EMPLOYEE database. When you enter this value, the stored procedure will return rows that match this department ID.

  3. Click OK.

A messages showing the status of the run is displayed in the DB Output view. Result sets are displayed on the Results page. You should see several rows of data displayed on the Results page that show D11 in the WORKDEPT column.

Now you are ready to begin Exercise 1.6: Exporting and deploying the stored procedure

Terms of use | Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.