/**
 判断一张表是否已经存在
 @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;
}

 



相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-26
  • 2022-03-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-04
  • 2021-06-01
  • 2022-02-15
  • 2022-12-23
  • 2022-12-23
  • 2021-12-08
相关资源
相似解决方案