Run Direct SQL Queries

The Oracle Autonomous Database add-on for Google Sheets lets you run SQL queries to work with your data in a Google Sheet. With the add-on, you can type your SQL code in the SQL editor area and click Run to run the command.

The add-on loads the result in the Google Sheet. The time taken to load the results depends on the number of records and the complexity of the query.

To run a query using the add-on, open Google Sheets and a blank workbook.
  1. In the Google Sheet, select the menu item Oracle Autonomous Database.
  2. Select Direct SQL to type and run the SQL command.
  3. The Oracle Autonomous Database wizard opens Tables and Views icons and a search field beside it.


    Description of native-sql-tables.png follows
    Description of the illustration native-sql-tables.png
  4. Select Table to view all the tables in the database. Perform the same operations for Views.
  5. You can right-click on the table whose data you want to query and choose Select to view all the table's columns. The column names will be displayed in the Write a Query section. You can click on the table and view individual columns as well.


    Description of native-sql-select.png follows
    Description of the illustration native-sql-select.png
  6. Click Run to run the query and display the results in the worksheet. You can click the + sign beside the Select worksheet drop-down to display the results in a new worksheet.
  7. The worksheet also displays the timestamp, the user who creates and runs the query, the ADB URL, and the SQL Query.
    Description of nativesql-results.png follows
    Description of the illustration nativesql-results.png