Use the query perspective to execute SQL statements. To switch to this perspective, use the Perspective ▸ Query execution (SQL) menu, or the Ctrl+S shortcut.
The perspective is divided in two horizontal panes: the left pane for the user defined favorite statements, and the right pane being the action area.
In the figure above, there are two favorites: a SELECT statement (named "List customers") and an INSERT statement (named "New customer ..."). The INSERT statement needs one "name" parameter, whereas the SELECT statement does not require any parameter to be executed.
The icon difference between the two illustrates the fact that the INSERT favorite is also marked to be an: it will be proposed as an action to be executed when the contextual menu is brought up in any grid representation of a resultset.
The left part of the perspective lists the favorite statements which have been user defined. Activating a favorite (double clicking) resets the SQL text area's contents to the selected statement's SQL.
The right pane is composed of zero or more tabs where the SQL is entered and executed. In each tab there is:
an SQL area in the top left part
command buttons in the top right part
execution history in the lower left part
execution results in the lower right part
The SQL area is an SQL editor. The SQL can be any SQL understood by the database, with the exception of(which must have a specific syntax).
The keyboard shortcuts in the SQL editor are:
Ctrl+SPACE to obtain a completion list
Ctrl+ENTER to execute the SQL code
Ctrl+l to clear the editor
Ctrl+Up and Ctrl+Down to navigate through the editor's history
The execution history part contains a list of the past executed statements, ordered by execution date along with an indication when the statement was executed (11 minutes in the figure above). Selecting an history item displays the corresponding result in the execution results part.
The Copy button copies the currently selected history item's SQL code to the SQL editor, and the Clear button removes all the history items.
Note that any given history item can also be removed individually using the Suppr key.
The Execution results part displays the execution result of the currently selected execution history item, as a table for SELECT statement, giving information for other types of statement, or giving the execution error notice if the execution failed.
Got a comment? Spotted an error? Found the instructions unclear? Send feedback about this page.