RWDBCriterion and RWDBExpr
Internally, RWDBExpr instances are data structures in the form of trees. The RWDBCriterion class derives from RWDBExpr and, therefore, is similarly structured. Example 3 results in an RWDBCriterion instance containing a three-node binary tree. The root node represents the dyadic expression of the operator ==. The two leaf nodes represent the column and the literal integer 17.
It is important to note that evaluation of RWDBExpr instances is performed by the library at the time of the execution. Expressions that produce RWDBExpr or RWDBCriterion instances might look like any other C++ expression, but their evaluation is deferred to the access library module.
Here is another example, which constructs a more complex RWDBCriterion instance. Assume that an RWDBSelector instance already exists:
Example 5 – Creating a complex WHERE clause
aSelector.where((col1 % 5 == 0) || col2.isNull());
The underlying access library module evaluates this expression according to its own syntax. For the Oracle database, the expression would be evaluated as:
 
WHERE (MOD(COL1, 5) = 0) OR COL2 IS NULL
For Sybase it would be slightly different:
 
WHERE (COL1 % 5 = 0) OR COL2 IS NULL
This difference arises because the Oracle database has a modulus function, while the Sybase database has a modulus operator.