Previous Topic: Use &NDBQUOTE to Protect Special Characters

Next Topic: CONTAINS

Search for Lowercase Data

An NDB can store character data in lowercase. When a character field is defined, CAPS=YES is assumed, which means that both the stored data and the key are folded to uppercase. Two other options are available:

CAPS=NO

The data is left as is, that is, lowercase data is left lowercase, including in the key. For example, ABC and abc are regarded as different values.

CAPS=SEARCH

The data is left as is, that is, lowercase data is left lowercase. If the data is keyed, the key is folded to uppercase. Thus, the values ABC and abc are regarded the same when building a key, but, when data is returned, the lowercase version is retained.

For &NDBSCAN, CAPS=SEARCH also applies to non-keyed fields for processing. That is, when reading data records, fields defined with CAPS=SEARCH are folded to uppercase when they are examined.

Supplied search arguments are retained in lowercase (or as entered), and are upper cased as required (that is, when comparing to CAPS=YES or CAPS=SEARCH fields).

Note: &CONTROL NOUCASE must be in effect to preserve lowercase information supplied on an &NDBSCAN statement.