DB2 graphic QMF Version 8

Generate programs

Program Generator generates three basic types of programs: QMF report programs, stored procedure programs, and data layer programs.

The Generate Programs option guides you through the process of specifying and locating the inputs (queries, forms, and procedures), specifying options for the programs to be generated, and generating the programs. This option provides hooks into other Program Generator options (Prepare Programs and Run Programs) to automatically perform additional functions on a program once it is generated. It also provides a mechanism to register generated programs for use with the End User Facility.

QMF report program

At the simplest level, a QMF report is the result of issuing the QMF commands RUN QUERY and PRINT REPORT. A report program generated by this facility produces the same result, although there might be significant variations on a program's function (for example, it might also perform a SAVE DATA command). In this manual, a query (or a query and form) is often referred to as a report. QMF procedures, which consist of a series of QMF commands, contain one or more reports. Program Generator can generate one program for each report in a procedure, and can also generate a single proc (procedure) program that runs each of the report programs in the procedure.

Stored procedure program

A stored procedure program is a program stored at a DB2 server that can execute SQL statements and perform other functions. A client application, on either the same machine or a remote machine, can invoke the program using the SQL statement CALL. There are many advantages to using stored procedures. You should consult the documentation provided with your licensed DB2 product for more information. This documentation is essential for fully understanding and taking advantage of the support for stored procedures in Program Generator.

Note:
Program Generator supports DB2 stored procedure that run in a WLM-managed address space only. Stored procedures that run in the DB2-managed stored procedure address space are not supported.

Program Generator generates stored procedure programs from QMF queries. Substitution variables used in an input query are converted to input parameters for the generated stored procedure. If the query is a SELECT statement, the result set returned by that SELECT statement can be returned as a result set from the stored procedure.

Data layer program

A data layer program is a general utility program providing access to DB2 in order to retrieve data (via an SQL cursor or SELECT INTO statement) or to manipulate data (via an SQL INSERT, UPDATE, or DELETE statement). Data layer programs are generated from QMF queries, but do not provide any QMF-specific functionality, such as reports or procedure commands. Unlike stored procedure programs, they are intended to be called directly from other programs (rather than being invoked directly or via the SQL statement CALL), and they accept input variables and return output variables via the LINKAGE SECTION of the program.


Go to the previous page Go to the next page

Downloads | Library | Support | Support Policy | Terms of use | Feedback
Copyright IBM Corporation 1982,2004 Copyright IBM Corporation 1982, 2004
timestamp Last updated: March, 2004