Editing routines that are deployed in a database

You can edit routines that are deployed in a database. You deploy the updated routine to replace the original routine in the database.

About this task

You open routines from the Data Source Explorer view or the Administration Explorer view. You edit the routine in the routine editor. After editing the routine, you can deploy the routine to replace original routine in the database. You can also save the routine as a file.
Tip: You can save a routine that is deployed in a database to your workspace by dragging and dropping the routine from the Data Source Explorer view or the Administration Explorer view into a project.

Procedure

To edit a routine that is deployed to a database:

  1. Open the Data Source Explorer or Administration Explorer.
  2. In the explorer view, navigate to the routine, right-click the routine, and click Open with Routine Editor.
    • From the Data Source Explorer, go to the Schemas folder of the database. In each schema folder, there is a PL/SQL packages folder, User-Defined Functions folder, and Stored Procedures folder. Open the folder to view the routine for the schema.
    • From the Administration Explorer, open the Application Objects folder. When you select the PL/SQL packages folder, User-Defined Functions folder, or Stored Procedures folder, the routines are displayed in the Object List.
    A copy of the routine opens in the routine editor.
  3. Edit the Routine.

    After you modify the routine, you can save the routine as a file on your computer when you deploy the updated routine.

  4. Deploy the routine. In the routine editor, click Deploy the routine to the database server button. The workbench prompts you to save the modified routine. You can save the routine as a file on your computer. The file contains the routine source code and property information from the database.

    The Deploy Routines wizard opens.

  5. Complete the wizard. When deploying routines, enable debugging by selecting Enable debugging in the Routine Options page of the wizard.

    The edited routine replaces the original routine in the module.

  6. Run or debug the routine from the routine editor.
    • To run the deployed routine, click Run the routine on the database server button.
    • If you enabled debugging, click Debug the deployed routine on the database server button to debug it.

What to do next

After deploying the routine for debugging, you can debug or run the routine from the routine editor, the Data Source Explorer, or the Administration Explorer.

From the workbench, you open a routine file that you saved on your computer by selecting File > File Open. When you open a routine file, you specify database connection information. The connection that you select is used when you deploy and run the routine.


Feedback