Admin Production rocket
Current Publication

COBOL DB2 Stored Procedures

Visual COBOL Development Hub V8.0
Rocket® Visual COBOL® (formerly a product of Micro Focus or formerly a product of Open Text) documentation, created before Rocket Software acquired certain products from OpenText, may include outdated references to "Micro Focus" or "OpenText", both of which are trademarks of OpenText or its affiliates. Rocket Software is not affiliated with Micro Focus or OpenText and has since rebranded these products as Rocket® products. You may also encounter outdated links in this documentation. If you do, please contact Rocket Support (support@rocketsoftware.com) for assistance.

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.