Search for the object with the specified oid.
MCO_RET mco_uda_oid_find( /*IN*/ mco_trans_h t,
/*IN*/ mco_uda_value_t * id,
/*OUT*/ mco_uda_object_handle_t * obj );
t
id
mco_uda_value_t
structure containing the oid to search.obj
mco_uda_object_handle_t
struct to receive the UDA object found.Searches the database for the object with the specified oid.
MCO_S_OK
MCO_E_UDA_WRONG_VALUE_TYPE
id is not an oid or autooid value.MCO_S_NOTFOUND
Snippet from schema:
struct oid_struct {
uint4 id;
};
declare oid oid_struct[10000];
Application snippet:
int main(int argc, char** argv)
{
MCO_RET rc;
mco_db_h db;
mco_trans_h t;
mco_uda_object_handle_t obj;
oid an_oid;
mco_uda_value_t val;
...
an_oid.id = 1001;
val.type = MCO_DD_OID;
val.v.p.p.v = &an_oid;
...
rc = mco_trans_start(db, MCO_READ_ONLY, MCO_TRANS_FOREGROUND, &t);
if ( MCO_S_OK == rc )
{
rc = mco_uda_oid_find(t, &val, &obj);
...
rc = mco_trans_rollback(t);
}
}