void CommandInsert(const char *table, const BTkey& key, int ptr) { int i; if ((i = GetTable(table)) == NOT_FOUND) { cerr << "Table not open!\n"; return; } GiST *gist = tables[i].gist; gist->Insert(BTentry(key, ptr)); cout << "(" << key << ", " << ptr << ") inserted into " << table << ".\n"; }
void CommandInsert(const char *table, const BTkey& key, int value) { int i; if ((i = GetTable(table)) == NOT_FOUND) { cerr << "Table not open!\n"; return; } Record* rec = new_in(db, Record); rec->value = value; GiST *gist = tables[i].gist; gist->Insert(BTentry(key, (GiSTpage)rec)); cout << "(" << key << ", " << value << ") inserted into " << table << ".\n"; }