MCO_RET mco_uda_to_mco( /*IN*/ mco_uda_object_handle_t * udaobj,
/*OUT*/ MCO_Hf * ret );
| udaobj | Handle of a UDA object |
|
ret |
The address of a variable to receive the "native" database object handle |
This function makes a “native” object handle from a UDA object handle. This can be useful when it is necessary to mix UDA calls with native API calls that have no UDA counterpart, for example, XML functions.
| MCO_S_OK | 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;
unsigned short index_no = 2;
unsigned short field_no;
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 = mco_uda_cursor(t, rec_struct_no, index_no, &csr);
rc = mco_cursor_first(t, &csr);
rc = mco_uda_from_cursor(t, &csr, &uda_obj); /* Get object handle from cursor */
rc = mco_uda_to_mco(&uda_obj, &rec_obj);
if ( MCO_S_OK == rc)
{
/* Do something with the Record object */
...
}
}
...
}