我编写了sqlite语句的代码如下:
if(sqlite3_open([[self filepath] UTF8String], &db) == SQLITE_OK)
{
retrievestatement = nil;
if(retrievestatement == nil) {
const char *sql = "Select * from OrdersHeaderTable where orderPlaceDate like '%?'";
if(sqlite3_prepare_v2(db, sql, -1, &retrievestatement, NULL) != SQLITE_OK)
NSAssert1(0, @"Error while creating detail view statement. '%s'", sqlite3_errmsg(db));
}
sqlite3_bind_text(retrievestatement, 1, [year UTF8String], -1, SQLITE_TRANSIENT);
while(sqlite3_step(retrievestatement) == SQLITE_ROW)
{
NSLog(@"value is %@",[NSString stringWithUTF8String:(const char*)sqlite3_column_text(retrievestatement, 0)]);
}
sqlite3_finalize(retrievestatement);
}
但它没有得到数据。请建议我。