Previous Topic Next topic Print topic


DB2 Stored Procedures

A stored procedure is a compiled program that can execute SQL statements.You need to use stored procedures if your application program operates in a client/server environment, and if either of the following two problems apply: The application accesses host variables for which you want to guarantee security and integrity. The application executes a series of SQL statements, creating many network send and receive operations, which significantly increase CPU and elapsed time costs.

Stored procedures are stored at 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.
Previous Topic Next topic Print topic