8.1.1.1 Analysis Constraints

For both distinct value counts and null counts, you can specify optional constraints. The XML format for two of the files is identical. For a join analysis, the XML format uses a filter element that is similar to a constraint. However, you must specify the table name.

To specify a constraint, use the <CONSTRAINT> element. The <CONSTRAINT> element requires three attributes:

  • Field: Database field name to which the constraint applies
  • Value: Value being compared
  • Operator: Operator used in the comparison
The following table lists valid code operators.

Table 8-2 XML Code Operators

XML Code Operator Comparison Operator
GT >
LT <
EQ =
LTE <=
GTE >=
NEQ <>
EMPTY Blank Character
The following code sample illustrates the use of the <CONSTRAINT> element:
<CONSTRAINT field="DATA_DUMP_DT" operator="EQ" value="15-NOV-2006"
    />
To include a constraint that filters out null columns, use the EMPTY operator and set the value to is not null. The following example illustrates the use of the EMPTY operator:
<CONSTRAINT field="DATA_DUMP_DT" operator="EMPTY" value="is not null"
        />

You can also use the EMPTY operator to perform more complex comparisons than those that other operators support that Table 55 lists. When using the EMPTY operator, the generated SQL statement includes the field name, a space, and the text within the value string. As such, representation of more complex operations is possible.

An AND operator joins any existing, multiple <CONSTRAINT> elements.

When adding date constraints as in the first example above, you must specify the date in the same format as the database’s NLS Date Format. Oracle recommends DD-MON-YYYY as the default format