Creating DB2 stored procedures

You can use the New Stored Procedure wizard to create DB2 stored procedures in SQL or Java.

Prerequisites: Before you can create a routine, complete the following prerequisite steps:

Using the New Stored Procedure wizard, you name the stored procedure, define the structure and SQL statement, and specify the parameters and additional options. You can also customize the generated source code by specifying files that contain code fragments. You can specify the following types of code fragments:

To create a stored procedure using the wizard:

  1. Switch to the Data perspective.

  2. In the Data Definition view, right-click the Stored Procedures folder under a database definition, and click New > SQL Stored Procedure or New > Java Stored Procedure. The New Stored Procedure wizard opens.

  3. Complete the steps of the wizard.

The wizard creates the stored procedure and adds to your database definition in the Stored Procedures folder.

 

Parent topic

DB2 stored procedures

 

Related concepts

Overview of DB2 stored procedures tasks
Tips for developing DB2 stored procedures

 

Related tasks

Preparing to debug a DB2 SQL stored procedure

Related reference
Stored procedure task restrictions
Stored procedure and user-defined function support by DB2 Universal Database server type