- (BOOL) isTableOK:(NSString *)tableName
{
FMResultSet *rs = [self.DB executeQuery:@"select count(*) as 'count' from sqlite_master where type ='table' and name = ?", tableName];
while ([rs next])
{
// just print out what we've got in a number of formats.
NSInteger count = [rs intForColumn:@"count"];
NSLog(@"isTableOK %d", count);
if (0 == count)
{
return NO;
}
else
{
return YES;
}
}
return NO;
}
FMDB中判断Sqlite的表是否存在
最新推荐文章于 2021-03-04 21:03:02 发布