Defining Stored Procedures

The following statement shows an example of creating a stored procedure. There are many options when creating stored procedures, but some of the main ones include a parameter list, the language, and its external program name. The actual definition is stored in the SYSIBM.SYSROUTINES catalog table, and the parameter definitions are stored in SYSIBM.SYSPARMS. The CREATE PROCEDURE statement creates a stored procedure.

 CREATE PROCEDURE SYSPROC.MYSP1 ( IN PARM1 SMALLINT, INOUT PARM2 CHAR(10), OUT CODE INTEGER ) EXTERNAL NAME 'CERTSP1' -- Load module name LANGUAGE COBOL -- language PARAMETER STYLE GENERAL -- type of parameter list COLLID DB2SPS -- collection ID ASUTIME LIMIT 2000 -- maximum amount of SUs allowed STAY RESIDENT ...

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.