Editing an SQL statement
Using the SQL editor, you can work with DDL source. The SQL Builder provides a graphical interface for creating SQL statements.
If you want to create an interactive SQL statement in DDL, you can use the SQL editor to edit a file with the extension .sql. If you imported or created an SQL DDL file with the extension .sql, it opens in the SQL editor. This editor has highlighting and content assist to help you complete your statement.
If you want to use the SQL Builder to edit an SQL statement, create your statement from the Data Definition view (in the Data perspective) or use the Create A New SQL Statement wizard to create a statement that ends with the extension .sqx. You can edit an .sqx file in the SQL Builder by double-clicking the file in the Navigator view of the Data perspective.
If you have an SQL file that is not saved in an .sqx file and that you want to edit in the SQL Builder, you can connect to a database, and create a statement of the needed type. You can then paste your original SQL source into the SQL Source pane of the SQL Builder (which automatically opens when you create your empty statement).
Content assist is available on the pop-up menu of the SQL Source pane in the SQL Builder and on the pop-up menu in the SQL editor.
Note: When you save your SQL statement in the SQL Builder, it is not validated automatically. To turn on the validation function, click Windows > Preferences to open the Preferences window, expand the Data node, click SQL Query, and then select the Validate query statements by executing before saving check box. Your SQL statements are validated before they are saved and any errors appear in the Tasks view.
Adding and removing tables and columns
You can add one or more tables or views to your SQL statement, depending on the type of statement that you are creating.Defining conditions
To modify the conditions for an SQL statement, first switch to the Data perspective, and then open your SQL statement in the SQL Builder.Using host variables in an SQL statement
Host variables can be used in an SQL statement to represent a value that will be substituted in at execution time. The host variable syntax is a symbol followed by a string; for example, :companyname. The symbol used depends on the syntax your database vendor uses to denote variables.Building expressions
Using the Expression Builder wizard you can build complex expressions or subqueries. An expression specifies a value. It can be a simple value, consisting of only a constant or a column name, or it can be more complex.
Parent topic
Working with SQL statements
Related concepts
Create A New SQL Statement wizard
SQL Builder
Related tasks
Opening the SQL Builder
Executing an SQL statement
Creating a DELETE statement
Creating an INSERT statement
Creating an UPDATE statement
Creating a SELECT statement
Creating a FULLSELECT statement
Creating a WITH statement