Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

Contains Matches

The locate() function finds the location of one string within another. It returns 0 when it doesn't find an exact, case sensitive match; otherwise, it returns the character position of the first match. The first character is position 1.

The substring() function returns a string out of another string starting at a specific character position for the specified number of bytes up to the end of the string. The first character is position 1.

The right() function returns a string out of another string starting at the end for the specified number of bytes up to the beginning.

The left() function returns a string out of another string starting at the beginning for the specified number of bytes up to the end.

TIP: A match can be made case insensitive by wrapping the field name in the lower() function and comparing it to a lower case string constant:

"locate( lower(favoriteSaying), \"there\" ) == 1"

In This Section

Contains string

Does not contain string

Contains string after the Nth character

Contains beginning-string

Does not contain beginning-string

Contains end-string

Does not contain end-string

Contains mid-string

Does not contains mid-string

Previous Topic

Next Topic

Contains string

Include records where the "favoriteSaying" field contains "there". Matches include "There is no 'i' in team but there is in win." and "Once something is a passion, the motivation is there.".

"locate( favoriteSaying, \"there\" ) >= 1"

Previous Topic

Next Topic

Does not contain string

Include records where the "favoriteSaying" field does not contain "is". Matches include "Every strike brings me closer to the next home run." and "Float like a butterfly, sting like a bee.".

"locate( favoriteSaying, \"is\" ) == 0"

Previous Topic

Next Topic

Contains string after the Nth character

Include records where "favoriteSaying" field contains "there" after the first 10 bytes. Matches include "There is no 'i' in team but there is in win.".

"locate( favoriteSaying, \"there\", 10 ) >= 10"

Previous Topic

Next Topic

Contains beginning-string

Include records where the first 3 characters in a "name" field match the string "Muh". Matches include "Muhammad Ali".

"left(name, 3) == \"Muh\""

Previous Topic

Next Topic

Does not contain beginning-string

Include records where the first 3 characters in a "name" field do not match the string "Muh". Matches include strings like "Babe Ruth", "Pele", and "Wayne Gretzky", but not "Muhammad Ali".

"left(name, 3) != \"Muh\""

Previous Topic

Next Topic

Contains end-string

Include records where the 3 rightmost characters in a "name" field match the string "Ali". Matches include strings like "Babe Ruth", "Pele", and "Wayne Gretzky", but not "Muhammad Ali".

"right(name,3) == \"Ali\""

Previous Topic

Next Topic

Does not contain end-string

Include records where the 3 rightmost characters in a "name" field do not match the string "Ali". Matches include strings like "Babe Ruth", "Pele", and "Wayne Gretzky", but not "Muhammad Ali".

"right(name,3) != \"Ali\""

Previous Topic

Next Topic

Contains mid-string

Include records where the 3rd and 4th characters in a "name" field match the string "ch". Matches include strings like "Michael Jordan" and "Michael Schumacher".

"substring(name,3,2) == \"ch\""

Previous Topic

Next Topic

Does not contains mid-string

Include records where the 3rd and 4th characters in a "name" field do not match the string "ch". Matches include strings like "Michael Jordan" and "Michael Schumacher".

"substring(name,3,2) != \"ch\""

TOCIndex