Grass Valley K2 TX/MAM Database Protocol Manual v.2.2 User Manual
Page 9

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
Name
Description
char *table
The table from which to use the field, e.g.
“main_event".
char *logical
Which logical operator to use, e.g. LOP_AND.
char *criteria
The criterion type to use, e.g. COP_EQUALS.
char *field
The field to compare, e.g. "status".
int value
The value to compare, e.g. 2048.
Result
The result of the function is an integer with the following values:
Value
Description
0
Success, the criterion has been added.
-1
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 );