SQL and XQuery editor

You can develop queries for both relational and XML data by creating SQL and XQuery statements in the SQL and XQuery editor.

The tool supports the creation of one or more statements of either type, as well as the nesting of either type of statement. Statements that you create and save are stored in a file with the extension .sql.

The SQL and XQuery editor provides the following features:
Top border
The top border of the editor contains connection information and command buttons.
  • The left side of the top border shows the database connection for the script that is open in the editor.

    If the string No Connection is displayed, the script is not connected to a database. You can select a database connection for the script by clicking the string to open the Select Connection Profile wizard.

  • The right side of the top border provides the following command buttons for easy access:
    • Run SQL
    • Visual Explain
    • Query Tuner (shown only in products that include query-tuning functionality)
    • Import
    • Export
Command pane
The Command pane, which is located at the top of the editor, contains commands that are also available on the pop-up menu in the editor. You can use either the Command pane or the pop-up menu to perform the actions that are associated with the commands. You can hide the Command pane while you are not using it.
Multiple statement support
You can type multiple statements in an .sql file and then run them.
Variable statement terminator
By default, the SQL and XQuery editor uses a semicolon ( ; ) as the default statement terminator. You can specify a different statement terminator for the statements that you create in the SQL and XQuery editor.
Syntax highlighting
To aid you in differentiating the elements in an SQL statement or an XQuery statement, syntax highlighting renders different kinds of elements in the text in unique colors.
Content assist
Content assist is an editing tool that provides you with helpful information as you type an SQL or XQuery statement. For example, after you type the dot that follows a schema qualifier in an SQL statement, content assist supplies a list of the tables in the schema.

As you develop your statement, you can press Ctrl + Space at any time to see context-sensitive coding help in the content assist window.

Query parsing and validation
As you type, the parser checks the syntax of both SQL and XQuery expressions, and provides a visual indication of any errors that it detects in the query.

Feedback