为了更新表,我写了::update set =\"%@\" WHERE =\"%@\"",col1Value,col2Value];
但是,这是行不通的。请帮忙。
我的代码如下:
const char *dbpath = [databasePath UTF8String];
sqlite3_stmt *statement;
NSString *querySQL = [NSString stringWithFormat:@"UPDATE AssemblyAssessment SET countedunits=\"%@\" WHERE assemblyid=\"%@\"",self.SAcountedunits,self.asmbIdStr];
const char *query_stmt = [querySQL UTF8String];
if (sqlite3_prepare_v2(ipadSites,query_stmt, -1, &statement, NULL) == SQLITE_OK)
{
if (sqlite3_step(statement) == SQLITE_DONE)
{
NSLog(@"done...");
}
else
{
NSLog(@"not done...");
}
sqlite3_finalize(statement);
sqlite3_close(ipadSites);
}