Specifying New Queries Using SQL Explorer

To specify a new query:

  1. In the context tree, select any object below (contained in) Databases.
  2. In the Database Hierarchy menubar, click (New) | Query.
  3. In the new query tab that SQL Explorer opens, enter the SQL statements you want to execute.

The query editor provides a menubar and a text area for writing SQL against the database context. The menubar provides the following buttons to help you define SQL statements:

Button Description
Execute

Displays the following choices:

  • Execute runs the SQL statements that appear in the text area and displays the result in the the Query Result panel.
  • Execute From File displays a dialog that lets you identify a file that contains SQL statements. SQL Explorer runs the query when you click Execute in that dialog.
  • Query Plan displays the query plan in the Query Result panel.
  • Export displays a dialog that lets you make some choices about how you want to export the query result to a text file. See Exporting Query Results Using SQL Explorer.
Stop Instructs SQL Explorer to stop waiting for a response from the database. See Handling Slow Queries When Using SQL Explorer.
List SQL Statements A selectable drop-down list of SQL statements and keywords. Double click a statement to insert it into the text area at the cursor.
List Tables A selectable drop-down list of table names defined in the current schema. Double click a table name to insert it into the text area at the cursor.
Split Statements ON/OFF ON/OFF toggle. Choose Split Statement ON for compound statements. Choose OFF for simple (one delimiter) statements.
Database Database context of the current query. You can set this from the drop-down list or in the Database Hierarchy context tree.
Schema Schema context of the current query. You can set this from the drop-down list or in the Database Hierarchy context tree.

Note: Each time you update a query, SQL Explorer automatically saves the query in the browser's local storage (HTML 5 support is required). If the browser window that is displaying SQL Explorer closes, for any reason, when you display SQL Explorer again all queries are restored from the browser's local cache. However, if you close a query tab in SQL Explorer then that content is removed from the cache.

You can use the following shortcuts in the query editor:

Shortcut Action
CTRL + F Find — Displays a search field at the top of the query editor. Enter a string or regular expression to search for and press Enter. SQL Explorer highlights the first match.
CTRL + G Find next.
CTRL + SHIFT + G Find previous.
CTRL + SHIFT + F Replace.
CTRL + SHIFT + R Replace all — After typing the string to search for and confirming with the Enter key, type the replacement string and press Enter.
CTRL + z Undo.
CTRL + y Redo.