Searching database fields with the LIKE and NOT LIKE operators

When searching database fields with the LIKE and NOT LIKE operators, IBM recommends that you always append a wild card character to the search string. Otherwise, queries might not produce the results you expect.

For example, suppose you define a database field as a fixed length string, twenty bytes in length. All values in the database must contain twenty characters. When loading data, if an index value contains less than twenty characters, Content Manager OnDemand adds one or more blank characters to fill the database field. For example, if the index value is "Clark", Content Manager OnDemand stores the letters "Clark" followed by fifteen blank characters in the database. The blank characters become part of the database value. Suppose you search the field with the LIKE operator and the search value "Clark". If you clear the Append checkbox, Content Manager OnDemand does not find a match because the blank characters are part of the database field value.

The correct way to match specified portions of character strings is to use the LIKE and NOT LIKE operators with wild card characters. If you clear the Append checkbox and the user does not add a wild card character to the search string, then Content Manager OnDemand locates only those documents that match the search string exactly.