Deleting records, Hc_delete_ez, Synopsis – Sun Microsystems Sun StorageTek 5800 User Manual

Page 111: Description

Advertising
background image

// list all OIDs from yesterday with test_status

t = 86400; // 86400 sec/day

date = gmtime(&t);

res = hc_pstmt_set_date(pstmt, 1, date);

res = hc_pstmt_query_ez(pstmt, selects, 1, 2000, &rset);

while (1) {

hc_oid oid;

hc_nvr_t *nvr

int finished;

hc_string_t test_status;

res = hc_qrs_next_ez(rset, &oid, &nvr, &finished);

if (finished)

break;

res = hc_nvr_get_string(nvr,

"test_status", &test_status);

printf(

"yesterday’s oid & test_status: %s %s\n", oid, test_status);

hc_nvr_free(nvr);

}

res = hc_qrs_free(rset);

Deleting Records

The following function is defined to delete records:

“hc_delete_ez” on page 111

.

hc_delete_ez

Deletes the metadata record for specified OID.

Synopsis

hcerr_t hc_delete_ez(hc_session_t *session,

hc_oid *oid);

Description

This function deletes the metadata record for the specified OID. When the last metadata record
associated with a data object is deleted, the underlying data object is also deleted.

Querying With a Prepared Statement

Chapter 3 • Sun StorageTek 5800 System C Client API

111

Advertising