Try OpenEdge Now
skip to main content
ABL Database Triggers and Indexes
Database Index Usage : Indexes and unknown values : Examples
 

Examples

Example 1: Using the sports database, the following query will display all records where cust-num is > 10 because cust-num is an indexed field and the Unknown value (?) will sort high in an indexed field:
FOR EACH cust WHERE cust-num >10 AND cust-num <= ?
However, the query below will display ZERO records because cust-num is the chosen index for the query. Since zip is not the chosen index, the Unknown value (?) will not sort high and the second part of the query will be false. No records are returned when one part of an AND is FALSE:
FOR EACH cust WHERE cust-num >10 AND cust-num <= ? AND zip >0 AND zip <?
Example 2: The same rule can affect queries where Unknown value (?) value is not explicitly used. Using the sports database, if you create three order records where order.cust-num = 1 and order-date = ?, then the following query will return the three records:
FOR EACH order WHERE order-date >= 1/1/97
However, the following query will return no records:
FOR EACH order WHERE order-date >= 1/1/97 AND cust-num = 1