0

我已更正我的数据库,但是当我启动命令时,我得到一个错误。

我的桌子:

a{ id int primary key not null, name varchar not null, and order int not null }

我的声明:

string query = "insert or replace into a (id,name,order) values (5,'hi',10)"
int rc;
rc = sqlite3_exec(db, query.c_str(), 0,0,&errMsg);
if(rc != SQLITE_OK){
    cout << "Error Code: " << rc << " SQLError: " << errMsg<<endl;
}

我不确定这应该如何工作。正在尝试插入。它会看到PK匹配......然后,它会替换,它会尝试用自己替换PK吗?我不确定。RC 给出的 Returned ErrorCode 是:

1   /* SQL error or missing database */
4

1 回答 1

0

The table was not created in the DB. One of the dev team changed the schema, dropped old tables, and added new ones without documenting, or giving me any sort of notification.

Should have it resolved though now.

于 2012-11-09T15:09:04.370 回答