Specifying the Tables for an SQL Statement

Use the Tables page of the SQLAssist SmartGuide to specify the tables that are accessed in an SQL statement. The table names that you select in the Tables page will appear in the FROM clause of the SQL statement.


Tables page of SQLAssist SmartGuide

The Table name field list the tables that you can access in the database identified by the currently selected connection alias. By default, the tables listed are those whose schema is the user ID specified for the database connection. If no tables in the database have that schema, all the tables in the database are listed.

You can add table names to those displayed in the list, by selecting View schema(s). You can filter the table names displayed in the list by selecting Filter table(s).

Selecting View schema(s) opens the Schema(s) to View window.


Schema(s) to View window

You are then prompted to enter additional schemas for the table name list. For example, if you enter a schema JOE, all tables that have the schema JOE in the database will be added to the table names already listed.

The % character is a wildcard character. For example, specifying %OE requests the display of all table names that are in a schema that ends with the characters OE. The specification J%OE requests the display of all tables names that are in a schema that begins with J and ends with OE.

You can display all the tables in the database by selecting View all.

Selecting Filter table(s) opens the Table Name Filter window.


Table Name Filter window

You are then prompted to enter the following information for the filter:

When you finish entering information that adds or filters table names in the list, select OK. This closes the Schema(s) to View or Table Name Filter window, as appropriate.

Select a table for the SQL statement by checking the checkbox next to the table name in the Table name list. You can select more than one table.

When you finish, select Next. This displays the Join page of the SQL Assist SmartGuide. Use this page to specify table joins for the SQL statement. You can also display any page in the SQL Assist SmartGuide by selecting its tab.

When you complete the specification of your SQL statement, select Finish. This generates the code for the SQL statement and closes the SQL Assist SmartGuide.

To cancel visual composition of the SQL statement, select Cancel.