SQL Editor


The SQL Editor can be associated with the appropriate file type (*.sql) like any other Eclipse editor. The file can then be opened from the Resource Navigator view using  Open With from the context menu. Alternatively, if a new file should be created, the SQL File creation Wizard can be opened from the Tables View context menu using New/SQL File.
The SQL Editor  is an editor for plain text files providing all commands known from the text editor. Each statement typed into the editor should end with a ';' (semicolon). If you forget it, the statements are submitted to the JDBC driver as one, and it depends on the driver to distinguish between them. Not every driver is capable to do so.
Furthermore the SQL Editor itself will have problems to select the current statement (Ctrl+Shift+A) if it does not find the semicolon.
 If you add the prefix  '--' to a line it will be considered to be a comment and ignored in execution.

Actions


Ctrl+E
Executes the selected statement or all statements in the active editor if no text was selected. Opens a new Table Editor with the result columns if the statement produces a result set.
Ctrl+Shift+E
Executes the selected statement or all statements in the active editor if no text was selected. Reuses the TableEditor that was opened from the last execution of a statement or opens a new one if no statement was previously executed with the result columns if the statement produces a result set.
Ctrl+Alt+E
Executes the selected statement or all statements in the active editor if no text was selected. The statement(s) are copied as persistent object under the element tree of the active database. The default name of the element is the execution time but it can later be changed from the Tables View.
Ctrl+Space
Content Assistance for SQL keywords and database elements. To set the assistance context there must be an active database selected in the Tables View. Best way to be sure to have that context set is to switch to a connection bookmark in the Tables View. If there is only one opened connection and the Tables View is not in the current perspective or has no element selected, then this connection automatically is the selected context.
Ctrl+Shift+A
(Three Mouse Clicks)
Selects the statement where the caret is currently positioned.
Ctrl+Shift+F
Formats the currently selected text or the complete editor content if no text is selected.

Toolbar Actions

execute symbol
(Ctrl+E)
Executes the selected statement or all statements in the active editor if no text was selected. Opens a new Table Editor with the result columns if the statement produces a result set.
scope symbol
If  turned on, the currently selected element in the Tables View determines a scope limit from within the context proposal will be generated. All other elements outside the scope are ignored.
If the selection is a table then all tables that are siblings of that table (all tables inside the same schema or catalog) are inside the scope.
Tip: Because the selection is easily lost it is better to Go Into the selected scope  to make it persist.


© Copyright Uwe Voigt 2002, 2003, All Rights Reserved.