嗨朋友我最近学习了 sqlite。我在 sqlite 中使用下面的代码来表示名称是否存在,但我没有得到结果。请帮我。BOOL columnExists = NO;
sqlite3_stmt *selectStmt;
NSString *upperString = [[NSString alloc] initWithFormat:exptypeFld.text];
NSString* changeString = [upperString uppercaseString];
NSLog(@"changeString %@",changeString);
[upperString release];
const char *sqlStatement = [[NSString stringWithFormat:@"SELECT expensetype from expensetypes where upper(expensetype) = '%@'",changeString] UTF8String];
NSLog(@"char is %s",sqlStatement);
if(sqlite3_prepare_v2(db, sqlStatement, -1, &selectStmt, NULL) == SQLITE_OK)
{
NSLog(@"Same........");
columnExists = YES;
}