You can use the New Stored Procedure wizard to create DB2® stored procedures
in SQL or Java™, or Derby stored procedures in Java.
Prerequisite: You must create a data development project.
Using the New Stored Procedure wizard, you name the stored procedure,
specify the stored procedure language, 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:
- For an SQL stored procedure: header, variables declaration, exception
handlers, and statements that precede the END statement
- For a Java stored procedure: header, import statements, class
variable declarations, and methods
To create a stored procedure from a data development project:
- Switch to the Data perspective.
- In the Data Project Explorer, right-click the Stored
Procedures folder in a data development project, and click New. The New Stored Procedure wizard opens.
- Complete the steps of the wizard. If you opened the
wizard by using the toolbar button, you must provide project and connection
information in the wizard.
The wizard creates the stored procedure and adds it to the Stored
Procedures folder, and the stored procedure opens in the routine
editor.