Running SQL or Java routines

After you create and deploy a routine such as a stored procedure or user-defined function, you can run the routine on the database server.

About this task

Restriction: Some products do not support Java™ routines.
Note: You should not run routines by using the Run As option from the pop-up menu in the routine editor.

Procedure

To run a SQL or Java routine:

  1. In either the Data Source Explorer or the Data Project Explorer, right-click the routine that you want to run, and click Run. Run Routines opens.
  2. Specify parameters and run options.
    • If the routine takes input parameter values, specify the parameters on the Parameters page. The page does not appear if the routine does not take parameters.
    • On the Run and Performance Options page, select whether you want to commit changes to the database, and for DB2® for z/OS®, specify the collection ID that you want to use.

      If Gather performance information is enabled, database performance information is collected and displayed in the SQL Results view.

      If Gather actual access plan information from the database is enabled, runtime statistics for the operations performed to execute the SQL statements are collected from the database. InfoSphere® Optim™ Query Workload Tuner uses the information when you tune the routine SQL statements.

    The routine runs on the database server.
  3. View the results that correspond to the run action in the SQL Results view. You can view messages, parameters, and result sets.

    If you gathered performance information for an SQL routine, the information appears in the SQL Results view. For SQL statements that perform poorly, you can right-click the statements and click Start Tuning to open the InfoSphere Optim Query Workload Tuner and tune the statements. To tune the statements from the SQL Results view, InfoSphere Optim Query Workload Tuner must be installed on the database that runs the statement.

Results

The parameters and run options are retained. You can change the values when you run the routine again.

What to do next

You can specify test configurations for your routines.


Feedback