Please enable JavaScript to view this site.

ESL Documentation

To manually build or edit an SQL statement, type its syntax directly in the SQL Editor window. You can do this at any time during a DB/Assist session after creating a new or opening an existing SQL statement, except when a dialog box is open.

To build one of the Other type SQL statements described in Building an Other Type Statement, you must type it in the SQL Editor window. However, building a statement manually may also be useful when you are building a simple SQL statement or are making only a small change to an existing statement.

Using SQL Editor Window Push Buttons

When you type the entire SQL statement into an empty SQL Editor window, you can use the Cut, Copy, Paste, Undo, and Validate push buttons to edit or validate the syntax just as you can when you import the statement or build it with the dialog boxes. For information about how to use these push buttons, see SQL Editor Window and Push Buttons.

Validating the Statement

When you type a SQL statement in an empty SQL Editor window, you must select the Validate push button to do the following:

Validate the statement syntax.

Enable the SQL Statement Button Bar and corresponding menu choices.

If an error message appears when you validate the syntax of a statement typed in the SQL Editor window, type the correct syntax in the SQL Editor window. Do not attempt to correct the syntax by using the DB/Assist dialog boxes to rebuild the statement.

Resolving Ambiguous Statement Types

If you create a SQL statement as one type in the New SQL Statement dialog box, and then change this type by entering the syntax for a different type in the SQL Editor window, DB/Assist can usually determine the correct statement type by checking the syntax.

For example, to determine whether an UPDATE or DELETE statement is searched or positioned, DB/Assist looks for a WHERE or WHERE CURRENT OF clause in the SQL Editor window. If it finds a WHERE clause, the statement is searched; if it finds a WHERE CURRENT OF clause, the statement is positioned.

However, if there is no WHERE or WHERE CURRENT OF clause in the UPDATE or DELETE statement, DB/Assist is unable to determine whether the statement is searched or positioned, and the statement type becomes ambiguous.

To resolve this, DB/Assist displays the Ambiguous Statement dialog box, as shown below. This dialog box appears when you perform certain actions, such as attempting to validate or run this statement, or create another statement.

AmbiguousStatement

Ambiguous Statement Dialog Box

If the Ambiguous Statement dialog box appears, follow these steps to complete it:

1.Check either the Searched or Positioned radio button to specify the type of UPDATE or DELETE statement.

2.Select the OK push button.

The dialog box closes. DB/Assist associates the type you specified with the UPDATE or DELETE statement in the SQL Editor window, and proceeds with the operation you requested before the dialog box appeared.