Benefits

One of the main reasons for using stored procedures is to reduce the network traffic in a distributed environment caused by client application programs that execute many remote SQL statements. Remote SQL statements can create many network send and receive operations to the server. A stored procedure can encapsulate many of the application's SQL statements into a single message to DB2, thus reducing network traffic.

Another reason for using stored procedures is to encapsulate a business function into a single module, coded once, and stored at the server for all processes to use. (See Figure 8-1.)

Figure 8-1. Stored procedure network improvements.

Additional Benefits

Some of the additional benefits of stored procedures include the following: ...

Get DB2® Universal Database™ for OS/390™ v7.1 Application Certification Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.