Product Documentation

FairCom DB API for C

Previous Topic

Next Topic

Using field names

Most record functions that operate on fields, take a field number as a parameter to indicate which field to operate on. ctdbGetFieldNumberByName() takes the field name and return its number.

If the field name passed to ctdbGetFieldNumberByName() is invalid, the function returns -1 (negative one).

/* update USERID field */

NINT fieldnbr = ctdbGetFieldNumberByName(hRecord, "USERID");

if (fieldnbr >= 0)

ctdbSetFieldAsString(hRecord, fieldnbr, "123456");

else

printf("Invalid field name\n");

Previous Topic

Next Topic

Operators

The following operators are allowed in filters and conditional expressions.

Mathematical Operators

+

Adds two operands

-

Subtracts two operands or negates an operand (e.g., -5)

*

Multiplication

/

Division

%

Modulus

Relational Operators

==

Equal to

!=

Not equal to

<

Less than

<=

Less or equal to

>

Greater than

>=

Greater than or equal to

Logical Operators

&&

And

||

Or

!

Not

Binary Operators

&

And

|

Or

~

Not

^

Xor

NULL Operators

IS NULL

IS NOT NULL

TOCIndex