
TX/MAM Database Protocol Manual - document version: 2.2 – Page 9
6.2 Adding a criterion that defines a restriction for integer database
fields
int cob_criteria_add_integer( char *table, char *logical, char *criteria,
char *field , int value );
Parameters
The table from which to use the field, e.g. “main_event".
Which logical operator to use, e.g. LOP_AND.
The criterion type to use, e.g. COP_EQUALS.
The field to compare, e.g. "status".
The value to compare, e.g. 2048.
Result
The result of the function is an integer with the following values:
Success, the criterion has been added.
Failure, the criterion could not be added.
Example
This example will retrieve all asset_elements with status_int == 1:
cob_criteria_clear();
cob_criteria_add_integer( "asset_element", LOP_AND, COP_EQUALS, "status_int" , 1 );
number_of_ids = cob_get_id_list( id_array, max_id_size );
Comentarios a estos manuales