IBM Books

Embedded SQL Programming Guide


Why Use Stored Procedures?

Figure 18 shows how a normal database manager application accesses a database located on a database server.

Figure 18. Application Accessing a Database on a Server


* Figure SQLA0F13 not displayed.

All database access must go across the network which, in some cases, results in poor performance.

Using stored procedures allows a client application to pass control to a stored procedure on the database server. This allows the stored procedure to perform intermediate processing on the database server, without transmitting unnecessary data across the network. Only those records that are actually required at the client need to be transmitted. This can result in reduced network traffic and better overall performance. Figure 19 shows this feature.

Figure 19. Application Using a Stored Procedure


* Figure SQLA0F14 not displayed.

Applications using stored procedures have the following advantages:


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]