classname_indexname_find

This function searches the database based on an exact match of index values.

Prototype

 
    MCO_RET	classname_indexname_find(	/*IN*/ mco_trans_h trans, 
                         /*IN*/ <type> [*]param1, 
                         [/*IN*/ uint2 len1,], 
                         [/*IN*/ <type> [*]param2, 
                         [/*IN*/ uint2 len2,] …], 
                         /*OUT*/ classname *handle );
 

Arguments

trans A transaction handle returned by mco_trans_start()

param1

A variable of type type, where type is the data type of the classname.fieldname component of the index. If the index component is char or string, the param is a char *

len1

If param1 is a char or string, len1 specifies the length of the input buffer

param2

If the index has more than one component (is a compound index) a search value is input for each component of the index

len2

If param2 thru paramN are char or string, each such parameter argument is followed by a lenN parameter to specify the length of the paramN buffer

handle

A pointer to a classname which will reference the object located by the find method

Description

Find methods search the database based on an exact match of index values. Since exactly one object can be returned, a pointer to an object handle is populated with the reference to the found object.

Return Codes

MCO_S_OK The object was located successfully.
MCO_S_NOTFOUND The search values did not match any object of the class
MCO_ERR_COMMON  

Related Topics Link IconRelated Topics