The SQL Editor is the area where you can display, edit, and execute SQL statements. It provides a Message window that displays success or error messages and warnings, and a Result window to display the query results, if applicable.
SQL Editor window
|Note:||A new SQL Editor window is automatically associated with the data source that is active in the Online Browser or Project Window. The active data source is displayed at all times in the Execution Target Bar. That is, all commands issued from SQL Editor will affect this particular data source only. If there are multiple data sources, the SQL Editor belongs to the one which was last clicked before you opened the SQL Editor. Any subsequent SQL Editor windows that you open will inherit the currently active data source.|
The Execution Target Bar (set to be visible by default) indicates at all times the database against which all statements in the SQL Editor will be executed. See also Execution Target Bar.
The SQL Editor window provides the following commands:
Runs the statement (or statements) displayed in SQL Editor against the database.
Execute for data editing
This command is applicable only for SELECT statements. It executes the SELECT statement and switches the results into editing mode. See also Retrieving and Editing Data.
Next Statement (Alt+Down)
If the SQL Editor contains multiple statements, this command jumps to the next statement and selects it.
Previous Statement (Alt+Down)
If the SQL Editor contains multiple statements, this command jumps to the previous statement and selects it.
Last Statement (Alt+End)
If the SQL Editor contains multiple statements, this command jumps to the last statement and selects it.
First Statement (Alt+Up)
If the SQL Editor contains multiple statements, this command jumps to the first statement and selects it.
Select Entire Statement
Selects the SQL statement in which the cursor is currently located.
Toggle Result Window(s)
Shows or hides the Result window containing the query results (if applicable). If the query returns multiple recordsets, then multiple Result tabs will be shown.
Toggle Messages Window
Shows or hides the Message window.
Show multiple results stacked
This option is applicable if the SQL Editor contains multiple statements which would retrieve multiple recordsets after execution.
If the option is on, all results are displayed in a single Result window with multiple panes for the individual queries. If this option is off, results of queries are displayed in separate, sequentially numbered tabs (Result1, Result2, etc). See also Viewing Results.
Show groupings for execution
If the SQL Editor contains multiple statements, this command displays statements as standalone execution blocks, if allowed by the context. See also Showing Execution Groups.
Opens the Export dialog box, see Exporting Database Data.
Re-parse the whole document
Re-parses the statements in the currently active SQL Editor window. This helps correct parsing errors that may have occurred during the initial parsing of the statement.
Apply SQL formatting to the active SQL Editor
Formats statements in the SQL Editor according to the SQL grammar defined for the current database type, see Formatting SQL .
Show/Hide execution target bar
Shows or hides the Execution Target Bar. Note that the Execution Target Bar will also be toggled off for all SQL Editor and Design Editor windows that you open subsequently.
Displays the Options dialog box, see DatabaseSpy Settings.