Running Procedures

Continuing our example from the previous section, you can run procedure PROCEDURE1. Before a procedure can run, it must first successfully build on the database. Table D.3 contains the icons related to running procedures.

Table D.3. Icons for Building and Running Procedures and Functions





Build the current object.


Runs the current procedure or function. If the object has not been built or has been updated since the last build, the Development Center can automatically (re)build it before running it.

PROCEDURE1 is fairly simple. It executes the following SQL statement:


The resulting rows are returned to the application as a result set (the Development Center, in this case), where the rows in the cursor are fetched.

Select PROCEDURE1 and click the Run button. The Development Center detects that a cursor has been returned and automatically fetches rows back from it.

You will be able to see the rows fetched back in the Results tab of the Output view, as shown in Figure D.22.

Figure D.22. Viewing data returned by cursors in the Development Center.

If you are running a function or a procedure with OUT parameters, the results will appear in the Parameters tab of the Output view (see Figure D.23). PROCEDURE1 does not have any parameters. Therefore, no values are listed here.

Figure D.23. Viewing input and output parameter values in the Development Center.

    DB2 SQL PL. Deployment and Advanced Configuration Essential Guide for DB2 UDB on Linux., UNIX, Windows, i5. OS, z. OS
    Intelligent Enterprises of the 21st Century
    ISBN: N/A
    EAN: 2147483647
    Year: 2003
    Pages: 205 © 2008-2017.
    If you may any questions please contact us: