Routines

A routine is an executable SQL object. The two types of routines are functions and procedures.

Functions

A function is a routine that can be invoked from within other SQL statements and that returns a value. You define functions by using the CREATE FUNCTION statement.

Procedures

A procedure, also known as a stored procedure, is a routine that you can call to perform operations that can include both host language statements and SQL statements.

Procedures are classified as either SQL procedures or external procedures. SQL procedures contain only SQL statements. External procedures reference a host language program that might or might not contain SQL statements.

SQL procedures provide the same benefits as procedures in a host language. ...

Get Official Introduction to DB2® for z/OS®, The, 2nd Edition 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.