Using Stored Procedures

Executing the CREATE PROCEDURE statement compiles a stored procedure library. The SQLVIEW Command generation recompiles any existing stored procedures. Refer to Stored Procedures in the Relational Database Server Query Processor Programming Guide for more information.

The stored procedures library is called <database>/MCPSQL/PROCEDURES/LIBRARY. The following files are required in order to compile the stored procedures library; these files are installed in the appropriate location with the standard installation of MCPSQL.

*SYSTEM/MCPSQL/PROCEDURES/LANGUAGE
*SYMBOL/MCPSQL/PROCEDURES/TEMPLATE
*SYMBOL/MCPSQL/PROCEDURES/DEFAULT

This library is only required at run time when stored procedures are executed using the CALL statement.

The name of the results file for the stored procedures library compile is called DDLRESULTS/MCPSQL/<database>/<mix number of SYSTEM/MCPSQL/PROCEDURES/LANGUAGE>. Check the contents of this file if syntax errors are encountered during the compile.

In addition to the stored procedures library, the following files are generated during the creation and compilation process:

<database>/MCPSQL/PROCEDURES/QD
<database>/MCPSQL/PROCEDURES/LOCK
<database>/MCPSQL/PROCEDURES/LANGUAGE

It is recommended that these four files be backed up along with the Enterprise Database Server files.

Two other files are created as work files during the compilation process. These files are deleted unless using the DIAGNOSTICS versions of the software. These files are called:

<database>/MCPSQL/PROCEDURES/CODE
<database>/MCPSQL/PROCEDURES/COMBCODE