【发布时间】:2012-01-11 19:40:55
【问题描述】:
我试图在我的 iPhone 应用程序上删除我的 sqlite 数据库中的一些条目,但出现了一个奇怪的错误。
这是我的代码:
if(sqlite3_open([databasePath UTF8String], &yerocDB)==SQLITE_OK)
{
sqlite3_stmt *compiledstatement;
NSString *deleteSql=[NSString stringWithFormat: @"delete from Favorites_Table where playlist_name = Studying and date = 1/1/2012"];
const char *sqlstmt = [deleteSql UTF8String];
if(sqlite3_prepare_v2(yerocDB, sqlstmt, -1, &compiledstatement, NULL)==SQLITE_OK)
{
int result = sqlite3_step(compiledstatement);
if(SQLITE_DONE != result)
NSAssert1(0,@"Error while creating delete statement => %s",sqlite3_errmsg(yerocDB) );
}else{
NSLog(@"didn't delete error: %s", sqlite3_errmsg(yerocDB));
}
sqlite3_finalize(compiledstatement);
}
然后我得到错误:
didn't delete error: no such column: Studying
playlist_name 和 date 是我的专栏...为什么说“学习”不是专栏?
【问题讨论】:
标签: iphone objective-c sqlite