This function deletes a database object (referenced by its class handle).
MCO_RET classname_delete( /*IN*/ classname * handle );
handle
class handle.This function will remove the object referenced by handle, and all of the object’s versions, from the database. Hash and tree index entries, if any, will also be removed.
MCO_S_OK
MCO_E_ACCESS
MCO_READ_ONLY.MCO_E_TRANSACT
MCO_E_DELETED
MCO_E_NOMEM
MCO_ERR_OBJECT_HANDLE
MCO_ERR_TRN
The following code snippets demonstrate how
classname_delete()is used to delete a database object.Snippet from schema file: class Record { uint4 key; hash <key> hkey; }; Application snippet: int find_delete(mco_db_h db, int hkey_val) { MCO_RET rc; mco_trans_h t; Record obj; rc = mco_trans_start(db, MCO_READ_WRITE, MCO_TRANS_FOREGROUND, &t); if ( MCO_S_OK == rc ) { rc = Record_hkey_find(t, hkey_val, &obj); if ( MCO_S_OK == rc ) { rc = Record_delete(&obj); } rc = mco_trans_commit(t); } }