
TX/MAM Database Protocol Manual - document version: 2.2 – Page 11
6.4 Adding a criterion that defines a restriction for string database
fields
int cob_criteria_add_string( char *table, char *logical, char *criteria,
char *field , char *value );
Parameters
The table from which to use the field, e.g."asset_element".
Which logical operator to use, e.g. LOP_AND.
The criteria type to use, e.g. COP_EQUALS.
The field to compare, e.g. "asset_string".
The value to compare e.g. "Clips".
Result
The result of the function is an integer that can have following values:
Success, the criterion has been added.
Failure, the criterion could not be added.
Example
This example will retrieve a list of all asset_elements with an asset_string value that equals to "Clips"
and with status_int value that equals to 1:
cob_criteria_clear();
cob_criteria_add_integer( "asset_element", LOP_AND, COP_EQUALS, "status_int" , 1 );
cob_criteria_add_string( "asset_element", LOP_AND, COP_EQUALS, "asset_string" , "Clips" );
number_of_ids = cob_get_id_list( id_array, max_id_size );
Komentáře k této Příručce