COBOL DB2 Stored Procedures

DB2 LUW allows embedded SQL calls to be executed as stored procedures. Stored procedures are routines executed directly by a DB2 LUW Server instance, rather than indirectly via a call to a routine from within a client application. The benefits of using DB2 stored procedures over SQL calls include enhanced modularity, security, and performance.

Stored procedures are stored on a local or remote DB2 LUW Server. Local DB2 LUW Server applications or remote DRDA applications can use the SQL statement CALL to invoke a stored procedure.

Note:
  • If you are running your stored procedure on DB2 for OS/390, through the DB2 Connect product, see your IBM DB2 documentation for other steps necessary to run the stored procedure.
  • For complete information on writing stored procedures and setting options for DB2 Database for Linux, UNIX, and Windows (LUW), see IBM's documentation on Developing User-defined Routines (SQL and External) and also their SQL reference material.