This topic describes how to run SQL statements or scripts in SQL Worksheet and download the results to a file.

  1. Open the navigation menu and click Developer Services.

  2. In the Database Tools section, click SQL Worksheet. You can also access SQL Worksheet from the Connection Details page of a specific database connection.
  3. 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.
  4. 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.

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

  6. To delete from the worksheet, click Clear. The complete contents of the editor are cleared.
  7. 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.
  8. 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.