Implementing Db2 stored procedures

You might choose to use stored procedures for code that is used repeatedly. Other benefits of using stored procedures include reducing network traffic, returning result sets to an application, or allowing access to data without granting the privileges to the applications.

About this task

A stored procedure is a compiled program that can execute SQL statements and is stored at a local or remote Db2 server. You can invoke a stored procedure from an application program or from the command line processor. A single call to a stored procedure from a client application can access the database at the server several times.

A typical stored procedure contains two or more SQL statements and some manipulative or logical processing in a host language or SQL procedure statements. You can call stored procedures from other applications or from the command line. Db2 provides some stored procedures, but you can also create your own.

Procedure

For detailed information about how to implement stored procedures: