When dBASE Plus compares two characters, an exact match (also known as a primary match) or an inexact match (also known as a secondary match) can be performed. An exact match is performed if the EXACT condition is set ON, and an inexact match is performed if EXACT is set OFF.

An exact match requires that the characters be exactly the same. For example, although the characters A and Å are similar, they don’t satisfy the requirement for an exact match, and a SEEK or a FIND expression treats them as different characters. In contrast, an inexact match requires only that the characters belong in the same general category. For example, since the characters A and Å are similar in several languages, they satisfy the requirement for an inexact match with many language drivers; a SEEK or a FIND expression treats them as identical characters.

Exact and inexact matches are performed using primary weights and secondary weights, which are assigned by a language driver to each character. Exact matches use primary and secondary weights, while inexact matches use only the primary weights and ignore the secondary weights. For example, the SET EXACT command controls whether characters with umlauts match their respective characters without umlauts. The following commands open a table named VOLK.DBF and search for a record with a key value that satisfies an exact match criterion:

set exact on

use VOLK order NAMEN

seek "KONIG" // Will NOT find "KÖNIG".

EXACT is ON and the secondary weights of O and ... are different, so they are evaluated as different characters. The following commands open VOLK.DBF and search for a record with a key value that satisfies an inexact match criterion:

set exact off

use VOLK order NAMEN

seek "KONIG" // Can find "KÖNIG".

EXACT is OFF and the primary weights of O and ö are the same, so they are evaluated as identical characters.