When comparisons are being performed, special logic is used to prevent records that do not have a given field present passing a test. The logic is called three-valued logic.
This example illustrates three-valued logic: There are 100 records on a database, 10 records with the NAME field present, containing the value SMITH, 65 records with the NAME field present, containing some other value, and the remaining 25 records having no name fields, then:
It is this three-valued logic that allows multiple-disjoint record types to share an NDB.
To explicitly match records with a given field PRESENT or ABSENT, operators of the same name are provided.
The null-field result propagates throughout the scan-expression. This means that the expression NOT (NAME EQ SMITH OR NAME NE SMITH) will not match all records with the NAME field absent. The result will always be no records. Only the ABSENT operator will match the records with the NAME field absent.
The &NDBCTL SCANDEBUG=YES option causes the action table to be displayed. The table shows the NULL-Field actions on each line, as well as the number of records passing each test.
| Copyright © 2009 CA. All rights reserved. |
|