About Running Oracle SQL Scripts
Oracle Developer Tools for Visual Studio includes a built-in, SQL*Plus compliant execution engine which runs SQL*Plus scripts. SQL*Plus scripts can include SQL and PL/SQL, as well as SQL*Plus specific commands.
To run script files, use one of the following methods:
-
Right-click on a script file project item, and select Run or Run On.
-
Right-click on the Oracle SQL Script Editor, and select Run or Run Selection.
-
Launch Run SQL*Plus Script from the Visual Studio Tools menu.
-
Drag and drop a script file to a database reference. This is supported within a single project, but not between projects.
When you run a script, the results appear in the Output Pane.
You can cancel running scripts. To cancel long-running queries, in the script project items of the Solution Explorer, select Cancel from the SQL editor menu, or from the Run SQL Script Dialog Box, select Cancel.
See Oracle SQL Script Compatibility Requirements for details on compatibility.
This section covers the following topics:
How SQL*Plus Script Execution Works
The following apply to Run SQL*Plus Script:
-
Script Execution
The script is executed in auto-commit mode by default, however, you can disable auto-commit in the script.
When it is required, script execution prompts for input parameters with an informational message box.
Execution continues even if any statements or commands in the SQL*Plus script return errors.
-
Results and Errors
The results and errors from the SQL*Plus script execution appear to the Oracle Output Pane in the Visual Studio Output Window. Results and errors are written after every statement in the script is executed.
-
Database Connection usage
Run SQL*Plus Script creates a new database connection every time you select OK to execute a SQL*Plus script. This database connection is closed after the script has been completed.
-
BOM Mark
Running scripts with BOM mark is not supported.
-
Special Characters in Script File Name
The SQL*Plus script file name cannot contain any of the following special characters:
*
,?
,"
,<
,>
,|
,/
,\
For file names containing these characters an
"Invalid
file
name"
error message appears in the output pane and the script will not run.
Running a Script from Oracle Database Project Version 2
If you right-click on a script in the Oracle Database Project Version 2, and select Run On, then the Run On dialog box launches.
You can choose which connection to use in the dialog box.
You can also drag and drop a script file to a database reference. This is supported within a single project, but not between projects.
See Also
Running a Script from Oracle SQL Script Editor
You can right-click on a script in the Oracle SQL Script Editor and select Run. The Run On dialog box launches. To cancel long-running queries select Cancel from the SQL editor menu.
Running a SQL Script Outside of the Oracle Database Project Version 2
To run a SQL script outside of the Oracle Database Project Version 2, you can use the Run SQL*Plus Script Dialog as follows:Select Run SQL*Plus Script from the Visual Studio Tools menu.This launches the Run SQL*Plus Script Dialog box.
See Also