MCO_RET mco_uda_from_mco( /*IN*/ MCO_Hf *mcoobj,
/*OUT*/ mco_uda_object_handle_t *ret );
| mcoobj | Handle of a database object |
|
ret |
A pointer to receive the UDA object handle |
This function makes a UDA object handle from a “native” database object handle. This can be useful when it is necessary to mix UDA calls with native API calls.
| MCO_S_OK | UDA object handle successfully returned |
| MCO_E_UDA_STRUCT_NOT_CLASS | Invalid object handle |
Application snippet:
int main(int argc, char* argv[])
{
MCO_RET rc;
mco_db_h db;
mco_trans_h t;
mco_cursor_t csr;
mco_uda_object_handle_t uda_obj;
Record rec_obj;
...
rc = mco_trans_start(db, MCO_READ_WRITE, MCO_TRANS_FOREGROUND, &t);
if ( MCO_S_OK == rc)
{
...
rc = Record_I_Index_index_cursor(t, &csr);
rc = mco_cursor_first(t, &csr);
rc = Record_from_cursor(t, &csr, &rec_obj); /* Get object handle from cursor */
rc = mco_uda_from_mco(&rec_obj, &uda_obj);
if ( MCO_S_OK == rc)
{
/* Do something with the UDA object */
...
}
}
...
}