示例#1
0
文件: command.cpp 项目: hkaiser/TRiAS
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";
}
示例#2
0
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";
}