Running a Stored Procedure

You can open a stored procedure and run it using the Query Options screen in DB2 Web Query.

To run a stored procedure:

1.         In the desired connection branch of the DB2 Web Query Tool navigation tree, expand the Stored Procedures section until you find the stored procedure that you want to use in your query.

2.         Click the desired stored procedure. A pop up menu opens.

3.         From the pop-up menu, select Open.

The Query Options page opens.

4.         In the Result Name field, type the name of the results set.

Note:     DB2 Web Query Tool provides a default results set name. You can replace this name with one that you prefer.

5.         In the Max Rows field, type the maximum number of rows to return in the results set.

Note:     To return all rows to the results set, enter "0" in the Max Rows field.

6.         In the Timeout field, type a time-out limit.

7.         From the Action drop down list, select an action to perform when a LOB is encountered. Select Omit to omit the LOB from the result set. Select Retrieve to have LOBs retrievable from the results set. When you select Retrieve, LOBs will appear as links in the results set. You can click the link to view a particular LOB and DB2 Web Query will retrieve that LOB for you from the DB2 table and show it in a viewer. Select Embed to have the LOB data embedded in the results set. LOBs in the results set will be viewable by clicking on a link. The LOB will appear in a viewer.

8.         In the Limit field, type the maximum size of a LOB that will be available in the results set.

9.         From the Type drop down list, select the type of LOBs to be included. Select Static and specify the file extension in the Ext./Column field to indicate that only LOBs with the specified extension will be shown. Select Column and type the name of the column, without the alias identifiers, that contains the information on the type of LOBS that will be shown in the Ext./Column field to indicate that only LOBs of the type specified in the specified column will be shown.

10.      If you have SQL\PA installed on you system and your query has not been analyzed by SQL/PA, "Not Analyzed" will appear next to SQL/PA in the SQL/PA section. To analyze your query with SQL/PA, click Analyze in the SQL/PA section of the Settings section. SQL/PA analyzes one statement at a time. Therefore, if you have more than one SQL statement embedded in your query, you will see results in a cumulative format. To set your SQL/PA analysis options, click Analyze options.

Note:     If you do not have SQL/PA installed, "Not Installed" will appear next to SQL/PA in the SQL/PA section.

11.      In the Parsed Query area, specify the values for any variables in the Stored procedure that you are using.

12.      To run the query click Run.