You can use the New Stored Procedure wizard
to create SQL or PL/SQL stored procedures from a database connection
in the Administration Explorer or the Data
Source Explorer.
Before you begin
Ensure the following requirements are met:
About this task
With the routine editor, you can create a SQL stored procedure
or PL/SQL stored procedure based on a template, then modify the code
in the editor as needed. This method is useful if you want to quickly
create a stored procedure and run it on the server.
Routine
development using a wizard is not supported for every available data
source. See Routine support by server type for details.
Procedure
To create a stored procedure from the Data
Source Explorer or Administration Explorer:
- In the explorer view, right-click the Stored
Procedures folder and click New Stored Procedure.
- In the Data Source Explorer, a Stored
Procedures folder is in each schema of the Schemas folder.
- In the Administration Explorer, the Stored
Procedures folder is in the Application Object folder.
The New Stored Procedure wizard
opens.
- Complete the steps of the wizard.
After you
specify a name and language, select a template to use as the starting
point for your stored procedure. Some templates are included with
the product, or you can create your own templates to share with other
team members using the Preferences page.
Results
The routine editor opens, initialized with a sample stored
procedure.
What to do next
Modify the sample stored procedure code as needed. Deploy
the stored procedure to your database and run the stored procedure.
You
can save the stored procedure as a file on your computer. The saved
file contains the source code and property information from the database.
You
open the saved file from the workbench by selecting . When you open the file, you specify database connection
information. The connection information is used when you deploy and
run the stored procedure.