2 Day Developer > Using Procedures, Functions... > Managing Stored Procedures ... > Creating a Procedure or Fun...
Creating a Procedure or Function With the Object Browser Page |
Previous |
Next |
You can use the Object Browser page to create stored procedures or functions. This section explains how to create a procedure.
To create a procedure:
Log in to the Database Home Page. See "Logging in to the Database Home Page". To run the examples in this guide, log in as user HR
with your password for the HR
account.
On the Database Home Page, click the Object Browser icon.
In the object list under Create, select Procedure.
Enter the procedure name (award_bonus
), check the Include Arguments box, and then click the Next button.
Enter information for the arguments, then click Next. Use the arguments in Example: Creating a Stored Procedure That Uses Parameters. For example:
Name IN/OUT Type
emp_id IN NUMBER
bonus_rate IN NUMBER
Enter the source code for the procedure body, then click the Next button. Enter the PL/SQL source code in Example: Creating a Stored Procedure That Uses Parameters.
Click the SQL tab to view the source code for the procedure body. If you need to make corrections, click the Previous button.
When you have finished, click the Finish button. You can click the Edit button to make updates to the subprogram, such as adding additional variable declarations outside the BEGIN
.. END
block as in Example: Creating a Stored Procedure That Uses Parameters.
Click the Compile button to compile the procedure. If errors occur, correct the source code and try compiling again. Compiling the procedure also saves any changes to the procedure.
When you have finished, click the Finish button.
In the previous steps, you created a procedure. For information about how to execute or call a procedure, see "Calling Stored Procedures or Functions".