In Db2 Admin Tool, you can create any of
the stored procedure types that are supported by Db2 for z/OS®.
Before you begin
Ensure that the Manage Stored Procedures (ADB2ZP)
panel is open. For
instructions on how to navigate to this panel, see Stored procedures.
Procedure
To create a stored procedure:
On the Manage Stored Procedures (ADB2ZP)
panel, specify option
2, and press Enter.
On the Create Procedure (ADB26CO)
panel, specify values for the
required fields, and press Enter:
Note: The Use CREATE OR
REPLACE field is displayed only if you are running Db2 12 and the current APPLCOMPAT value is 507 or
later.
Tips:
To create a native stored procedure, specify SQL in the
LANGUAGE field and Y in the Native
SP field.
To create an external stored procedure, specify the language of the procedure body in the
LANGUAGE field.
To create an external SQL procedure (which is deprecated in Db2 for z/OS), specify SQL in the
LANGUAGE field and N in the Native
SP field.
To cancel the process of creating a stored procedure, press End.
If the Create Stored Procedure Parameters
(ADB26COU) panel is displayed,
specify values for the required fields to define the first parameter, and press Enter. Repeat this
step until all parameters are defined.
This panel is displayed if you specified a number greater than zero (0) for the number of stored
procedure parameters (the Number of parameters field on the Create Procedure (ADB26CO)
panel). This panel is displayed for each parameter
that you need to define.
On the Create Stored Procedure Options
(ADB26COV) panel, enter values
for the relevant options, and press Enter.
The format of the Create Stored Procedure Options (ADB26COV) panel varies depending on the
language and type of stored procedure, the version of Db2, and the current APPLCOMPAT value.
Follow the remaining prompts to create the stored procedure.
The prompts vary
depending on the type of procedure that you are creating and your Db2 Admin Tool settings. For example, if you are creating a
native SQL procedure or an external SQL procedure, you are prompted to enter the procedure body.
Also, if Change Management is enabled or the statement execution prompt is turned on, additional
prompts are displayed.
When you complete all of the prompts, Db2 Admin Tool issues the SQL CREATE PROCEDURE statement
with the parameters that you specify.