SQL Pane

See Also      Tasks

The SQL pane displays the SQL statement for the current query. It is updated automatically as you build your query and reformatted to be easy to read.

In the SQL pane you can:

Note   Be sure you know the rules for identifying database objects in the database you are using. For details about SQL Server, see Query Designer Considerations for SQL Server Databases. For details about Oracle, see Query Designer Considerations for Oracle Databases.

Entering Statements in the SQL Pane

You can edit the current query directly in the SQL pane. When you move to another pane, the Query Designer automatically formats your statement, and then changes the Diagram and Grid panes to match your statement.

Note   You can enter optimizer hints for SQL statements, but the Query Designer might reformat them. For details about SQL Server, see Query Designer Considerations for SQL Server Databases. For details about Oracle, see Query Designer Considerations for Oracle Databases.

If your statement cannot be represented in the Diagram and Grid panes, and if those panes are visible, the Query Designer displays an error and then offers you two choices:

If you return to the SQL pane and continue editing the statement, the Query Designer dims the other panes to indicate that they no longer reflect the contents of the SQL pane.

You can also use the SQL pane to enter SQL statements that cannot be represented graphically in the Query Designer. In such cases, the Query Designer displays the same behavior as it does when it detects an error — it dims the Diagram and Grid panes to indicate that they do not represent the current statement. You can continue to edit the statement and execute it as you would any SQL statement. For details about unsupported query types in SQL Server, see Query Designer Considerations for SQL Server Databases. For details about unsupported query types in Oracle, see Query Designer Considerations for Oracle Databases.

Note   If you enter an SQL statement, but then make further changes to the query by changing the Diagram and Grid panes, the Query Designer rebuilds and redisplays the SQL statement. In some cases, this action results in an SQL statement that is constructed differently from the one you originally entered (though it will always yield the same results). This difference is particularly likely when you are working with search conditions that involve several clauses linked with AND and OR.