First page Back Continue Last page Graphics

Creating View Objects for Queries


Creating View Objects for Queries (continued)

The SQL Statement page of the wizard enables you to enter a custom SQL statement and to check its syntax. You also can specify an ORDER BY clause. There are buttons to invoke a query builder, to perform an explain plan, and to test the syntax of the query.

You can type in the query if desired, but clicking the Query Builder button enables you to build the query and helps to avoid typing mistakes. In the SQL Statement dialog box of the Query Builder, you can select Quick-pick objects in the tree at the left. Then select the schema and click Query to show the available tables or views, which you can expand to show the attributes. You select the objects from the Available list and shuttle them to the selected list to populate the query with the desired attributes and FROM clause. Selecting attributes under a foreign key ensures that tables are joined based on the foreign key. You can also define aliases on the Quick-pick objects page.

Selecting other elements from the tree at the left displays other pages that enable you to define various clauses or bind variables for the query.

After you have written the query, click Test for a syntax check.