Previous Topic Next topic Print topic


Compiling and Linking Stored Procedures under DB2 LUW

To compile and link a COBOL stored procedure using DB2 LUW:

  1. Compile and link the stored procedure as specified for your platform in the Building COBOL routines topic of the IBM DB2 LUW documentation.
  2. Copy the stored procedure object to the sqllib/function directory of your DB2 Instance.2
Note: 1If your program contains stored procedure CALL statements, you must specify the CALL_RESOLUTION DB2 directive to avoid an SQL0204 error.
Important: 2By default, after calling a stored procedure, DB2 LUW does not unload it until DB2 LUW is stopped. To avoid problems with copying the file, you can do one of the following if you are not in a production environment:
  • From a command prompt with DB2 administrator privileges:
    1. Execute db2stop.
    2. Copy the stored procedure binary file.
    3. Execute db2start.
  • From a command prompt configured for the DB2 LUW environment, execute:

    db2 update dbm cfg using KEEPFENCED NO

    Important: Do not execute the db2 update command in a production environment. Doing so results in significant performance degradation. Refer to your IBM documentation for more information on this command.
Previous Topic Next topic Print topic