标签:bool 存在 style ret resultset 判断 query ase count
/** 判断一张表是否已经存在 @param tablename 表名 */ - (BOOL)isExistTable:(NSString *)tablename{ if ([_dataBase open]) { FMResultSet *rs = [_dataBase executeQuery:@"select count(*) as ‘count‘ from sqlite_master where type =‘table‘ and name = ?", tablename]; while ([rs next]){ NSInteger count = [rs intForColumn:@"count"]; if (0 == count){ return NO; } else{ return YES; } } return NO; } return NO; }
标签:bool 存在 style ret resultset 判断 query ase count
原文地址:http://www.cnblogs.com/Crazy-ZY/p/6068688.html