Application Development Guide


Stored Procedure Overview

Use stored procedures to improve the performance of your client/server applications. A stored procedure is a function in a shared library accessible to the database server. Stored procedures access the database locally and return information to client applications. A stored procedure saves the overhead of having a remote application pass multiple SQL statements to the server. With a single CALL statement, a client application invokes the stored procedure, which then performs the database access work and returns the results to the client application.

You can write stored procedures using SQL, called SQL procedures. For more information on writing SQL procedures, see Writing SQL Procedures. You can also write stored procedures using languages such as C or Java. You do not have to write client applications in the same language as the stored procedure. When the language of the client application and the stored procedure differ, DB2 transparently passes the values between the client and the stored procedure.

You can use the DB2 Stored Procedure Builder (SPB) to help develop Java or SQL stored procedures. You can integrate SPB with popular application development tools, including Microsoft Visual Studio and IBM Visual Age for Java, or you can use it as a standalone utility. To help you create your stored procedures, SPB provides design assistants that guide you through basic design patterns, help you create SQL queries, and estimate the performance cost of invoking a stored procedure.

For more information on the DB2 Stored Procedure Builder, see IBM DB2 Stored Procedure Builder.


[ Top of Page | Previous Page | Next Page ]