WYRDTEK Home Features Reference Downloads About



int es_mbi_findupdate( struct es_mbi *iter, struct es_mbn *nd );


struct es_mbi *iter Database node iterator.
struct es_mbn *nd Database node.

Return Codes

ES_ERROR_NONE Success. No errors.
ES_ERROR_INVALIDBINDING The field-binding associated with iter is for a class that is not the same (or a valid super class) as that of the node nd.
ES_ERROR_MISSINGINDEX The field-binding associated with iterator iter is missing bindings for any index fields.
ES_ERROR_FAILTOFIND Failed to lookup row corresponding to index field values.


Look up row in database node nd and update its contents. If row does not exist, insert it and update the index. Set iterator to point at row.

The field-binding associated with iterator iter must contain bindings by-value for each field that makes-up the index for node nd. es_mbi_findupdate() uses these field values to look up the corresponding row in nd and then updates row-data for the remaining field bindings.

If the row cannot be found, es_mbi_findupdate() creates a new row, updates it and returns ES_ERROR_FAILTOFIND. The index is updated and iter is set to point at the new row.

[Back To Reference] [Back To Reference/es_mbi]