Creating a Procedure or Function With the Object Browser Page

Previous
Previous
Next
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:

  1. 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.

  2. On the Database Home Page, click the Object Browser icon.

  3. In the object list under Create, select Procedure.

  4. Enter the procedure name (award_bonus), check the Include Arguments box, and then click the Next button.

  5. 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
  6. 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.

  7. Click the SQL tab to view the source code for the procedure body. If you need to make corrections, click the Previous button.

  8. 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.

  9. 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.

  10. 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".