[AGENT++] Table with double index
Frank Fock
fock at agentpp.com
Wed Nov 26 00:59:24 CET 2008
Chaim Turkel - Israel wrote:
> How do I delete all rows based on the first index only?
>
Create and Oidx with the table's OID +
the first accessible column's index +
the first index. Then iterate over
the column instances within the index
range and delete the corresponding rows.
For example (pseudo code):
Oidx iterOID = new Oidx(tableOID);
iterOID += colIndex;
Oidx col2 = new Oidx(iterOid);
iterOID += myIndex;
for (MibLeaf* l = table->find_next(iterOID);
(l) && (col2.is_root_of(iterOID));
l = table->find_next(iterOID)) {
table->remove_row(l->get_reference_to_row()->get_index());
iterOID = l->get_oid();
}
Best regards,
Frank
More information about the AGENTPP
mailing list