Stored Procedures

A stored procedure is a compiled program which is stored at a local or remote DB2 server. This procedure can execute SQL statements, as well as connect to other DB2 servers and retrieve data from non-database systems. A stored procedure typically contains two or more SQL statements and some manipulative or logical processing in a host language. A client application program uses the SQL CALL statement to invoke a stored procedure.

EXEC SQL CALL MYSP (parm1, parm2, parm3)

A thread invoked SQL to call the stored
procedure passing it a series of parameters
that match the stored procedure definition

One of the main reasons for using stored procedures is to reduce the network traffic in a distributed environment caused by client ...

Get DB2® Universal Database for OS/390® Version 7.1 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.