Executing a SQL Script

You can execute scripts stored in the Script Repository. You can submit a script for execution either from the Script Editor or from the SQL Scripts page.

When you submit a script for execution, the Run Script page appears. It displays the script name, when it was created and by whom, when it was last updated and by whom, the number of statements it contains, and its size in bytes. It also lists unknown statements such as SQL*Plus commands that are ignored during execution.

If a script does not contain any runnable statements, the Run control does not display.

Topics:

See Also:

"About Long Operations"

Executing a SQL Script in the Script Editor

To execute a script in the Script Editor:

  1. Open the script you want to execute in the Script Editor. See "Using the Script Editor".

  2. Click Run in the Script Editor.

  3. The Run Script page appears.

    The Run Script page displays information about the script and lists statements in error preventing execution, or statements such as SQL*Plus commands that are ignored when the script is executed.

    The Run Script page has three controls:

    • Cancel returns you to the SQL Scripts page without executing the script.

    • Run in Background runs the script using DBMS_JOB rather than submitting for execution. This option is useful for long running scripts.

    • Run Now to submit the script for execution.

  4. Click Run Now to submit the script for execution.

    The Manage Script Results page appears listing script results.

  5. To view script results, click the View icon under View Results.

Executing a SQL Script from the SQL Scripts Page

To execute a script from the SQL Scripts page:

  1. On the Workspace home page, click SQL Workshop and then SQL Scripts.

    The SQL Scripts page appears.

  2. Click the View Report icon.

    Reports view appears.

  3. Click the Run icon for the script you want to execute. The Run icon is located on the far right side adjacent to the script name.

  4. The Run Script page appears.

    The Run Script page displays information about the script and lists statements in error preventing execution, or statements such as SQL*Plus commands that are ignored when the script is executed. The Run Script page has three controls:

    • Cancel returns you to the SQL Scripts page without executing the script.

    • Run in Background runs the script using DBMS_JOB rather than submitting for execution. This option is useful for long running scripts.

    • Run Now to submit the script for execution.

  5. Click Run Now to submit the script for execution.

    The Manage Script Results page appears listing available results for the script.

  6. Click the View icon for the results you want to view. The View icon is at the right end of the scripts listed in the Manage Script Results page.