To run a SQL statement or script from SQL Worksheet
This topic describes how to run SQL statements or scripts in SQL Worksheet and download the results to a file.
-
Open the navigation menu and click Developer Services.
- In the Database Tools section, click SQL Worksheet. You can also access SQL Worksheet from the Connection Details page of a specific database connection.
- On the SQL Worksheet page, use the Connection menu to select a database connection. Optionally, click the Change Compartment link to select a database connection in a different compartment. If there are no connections available, you can select the Create Connection option in the Connection menu to create a database connection. See Using the Oracle Cloud Infrastructure Console for more information.
- Enter a new statement or script in the editor, or load a saved
worksheet, or drag and drop an object from the left pane to automatically generate
the SQL statement.
To load a worksheet, click the Worksheet drop-down list in the toolbar and click Open.
For more information about the editor, see Running SQL, PL/SQL and JavaScript Code in the Worksheet Editor.
- To run a single SQL statement, select the statement and click
Run Statement. The SQL Worksheet parses the SQL editor's
contents and executes only the statement selected.
To run a script, click Run Script.
- To delete from the worksheet, click Clear. The complete contents of the editor are cleared.
- After an SQL statement runs, the results display in the Query Result section on the SQL Worksheet. For failed statement executions, an error code and error message is displayed instead of the results table.
- Click Download to save the results of the SQL query. Choose a file format for the downloaded file (CSV, HTML, JSON, or TEXT), then confirm that you want to download the file.
Select another database connection from the Select a Connection drop-down at any time.