This method is used to define a comparison between a given value
and the value of a column. (This method does not actually
execute the comparison, which is done later when performing the
scan for which this
NdbScanFilter is defined.)
In many cases, where the value to be compared is an integer, you
can instead use one of several convenience methods provided by
NdbScanFilter for this purpose.
NdbScanFilter Integer Comparison Methods.
int cmp ( BinaryCondition condition, int columnId, const void* value, Uint32 length = 0 )
Parameters. This method takes the following parameters:
condition: This represents the condition to be tested which compares the value of the column having the column ID
columnIDwith some arbitrary value. The
BinaryConditionvalue; for permitted values and the relations that they represent, see Section 184.108.40.206, “NdbScanFilter::BinaryCondition”.
COND_NOTLIKEare used to compare a column value with a string pattern.
columnId: This is the column's identifier, which can be obtained using the
value: The value to be compared, repesented as a pointer to
When using a
COND_NOTLIKEcomparison condition, the
valueis treated as a string pattern. This string must not be padded or use a prefix. The string
valuecan include the pattern metacharacters or “wildcard” characters
_, which have the meanings shown here:
Matches zero or more characters
Matches exactly one character
To match against a literal “%” or “_” character, use the backslash (
\) as an escape character. To match a literal “\” character, use
These are the same wildcard characters that are supported by the SQL
NOT LIKEoperators, and are interpreted in the same way. See String Comparison Functions, for more information.
length: The length of the value to be compared. The default value is
lengthhas the same effect as comparing to
NULL, that is using the
This method returns an integer:
0 on success,
-1 on failure.