Defining selection criteria

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:

  1. 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.
  2. Select the Tables tab.
  3. Select the OPTIM_CUSTOMERS table from the table list.
  4. Click Add Table Specifications. The Table Specification window opens.
  5. Select the Selection Criteria tab. The tab displays a WHERE clause for the table.
  6. Enter the following criteria: COUNTRY_CODE='US'.

    Click Check Syntax to verify the syntax and identify errors.

  7. 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.

  8. From the main menu, click File > Save 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'.



Feedback