Allocate a new object.
MCO_RET mco_uda_new( /*IN*/ mco_trans_h t,
/*IN*/ unsigned short struct_no,
/*IN*/ const void * oid,
/*IN*/ const mco_uda_value_t * initializers,
/*IN*/ unsigned short initializers_no,
/*OUT*/ mco_uda_object_handle_t * obj );
t
mco_trans_h transaction handle returned by mco_trans_start().struct_no
mco_dict_struct_count() - 1). It can be obtained through the class DDL name (see mco_dict_struct_name()).oid
initializers
initializers_no
obj
Allocates a new object. Note that the mco_uda_object_handle_t parameter obj is not a real descriptor and can’t be used in certain object related functions (for instance
mco_uda_delete()ormco_uda_checkpoint()).
MCO_S_OK
struct_no.MCO_E_UDA_STRUCT_NOT_CLASS
struct_no is not a class.
Application snippet:
int main(int argc, char* argv[])
{
MCO_RET rc;
mco_db_h db;
mco_trans_h t;
unsigned int record_no = 0;
...
rc = mco_trans_start(db, MCO_READ_WRITE, MCO_TRANS_FOREGROUND, &t);
if ( MCO_S_OK == rc )
{
mco_uda_new(t, record_no, 0, 0, 0, &obj);
...
rc = mco_trans_commit(t);
}
}