Previous Topic Next topic Print topic


Working with Stored Procedures

To get a stored procedure up and running:

  1. Do one of the following:
    • Add your installation's executable (bin) directory to the PATH statement
    • Copy either the cblrtsm.dll run time (threaded run time) or the cblrtss.dll (non-threaded run time) run time file to the directory from which you execute the stored procedure. You need to do this for DB2 to be able to execute a COBOL stored procedure.
  2. Code and prepare a stored procedure. See the topic Writing and Preparing Stored Procedures for instructions.
  3. Code and prepare an application that calls the stored procedure. An SQL statement, CALL, in that application must use the same parameter list and linkage convention as the stored procedure that it invokes. See the section Writing and Preparing Applications to Use Stored Procedures for instructions.
  4. Define your stored procedure to the DB2 LUW Server by issuing a CREATE PROCEDURE command, which will place a row in the appropriate system table(s). See the section Defining Stored Procedures under DB2 LUW for additional details.
  5. Compile your stored procedure. See the section Compiling Stored Procedures under DB2 LUW for additional details.
  6. Debug and test your stored procedure. See the section Debugging Stored Procedures under DB2 LUW for additional details.
Previous Topic Next topic Print topic