In this exercise, you will define selection criteria in
the access definition. Use selection criteria to focus on a specific
set of related data by defining an SQL WHERE clause and using substitution
variables with default values.
Selection criteria must conform to SQL syntax and include
relational or logical operators. Logical operators and syntax vary
among DBMSs. Refer to the appropriate DBMS documentation for information.
To
select the desired set of data for a table, you may need a combination
of AND and OR logical operators.
To
define selection criteria:
- Expand the Tutorial folder in the Directory Explorer, expand
the Access Definitions node, and double-click
the SAMPLE.AD access definition. The Access Definition
Editor opens.
- Select the Tables tab.
- Select the OPTIM_CUSTOMERS table from the table list.
- Click Add Table Specifications. The Table Specification window opens.
- Select the Selection Criteria tab. The tab displays a WHERE clause for the table.
- Enter the following criteria: COUNTRY_CODE='US'.
Click Check Syntax to verify the syntax
and identify errors.
- Click OK to return to the Access
Definition Editor.
If the syntax is not valid, a prompt
will open to identify to error. You cannot save the criteria if it
contains errors.
- From the main menu, click to save the access definition.
You have defined selection criteria that will only select
rows from the OPTIM_CUSTOMERS table in which the value of the COUNTRY_CODE
column is 'US'.