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.