//监测数据库中我要需要的表是否已经存在
NSString *existsSql = [NSString stringWithFormat:@"select count(name) as countNum from sqlite_master where type = 'table' and name = '%@'", @"Member" ];
FMResultSet *rs = [membersDB executeQuery:existsSql]; if ([rs next]) {
NSInteger count = [rs intForColumn:@"countNum"];
NSLog(@"The table count: %li", count);
if (count == 1) {
NSLog(@"存在");
return;
}
}
//检测某个数据是否存在
FMResultSet *rs =[membersDB executeQuery:@"SELECT COUNT(Name) AS countNum FROM Member WHERE Name = ?",self.nameTextField.text];
while ([rs next]) {
NSInteger count = [rs intForColumn:@"countNum"];
if (count > 0) {
//存在
}
else
{
//不存在
}
}

最新文章

  1. 客户关系管理系统-CRM源码
  2. linux 中文件权限和磁盘管理、linux服务器项目如何部署
  3. React Native 组件样式测试
  4. spring+ibatis整合
  5. Vue数据绑定隐藏的神坑....
  6. libgdx 常见问题
  7. MSSQL大数据量增加字段耗时对比
  8. Kafka集群模式部署
  9. 鸟哥的linux私房菜学习记录之正则表达式
  10. jsoup的基本写法
  11. 拥抱高效、拥抱 Bugtags 之来自用户的声音(四)
  12. [POJ] 3264 Balanced Lineup [线段树]
  13. 关于C++的子类指针指向父类
  14. STM32F4xx时钟理解
  15. 在现有代码中通过async/await实现并行
  16. Beta第二天
  17. webpack 样式表抽离成专门的单独文件并且设置版本号
  18. ELK之filebeat、logstash多个topic配置
  19. CentOS7.0小随笔——指令基本操作(Part.B)
  20. python性能分析之cProfile模块

热门文章

  1. .Cannot create an NSPersistentStoreCoordinator with a nil model
  2. 获取输入设备的vid和pid
  3. Eclipse如何自定义format代码
  4. UIView的基本属性及ANimation
  5. runtime——消息机制
  6. Json与Gson讲解
  7. 关于tag,viewWithTag
  8. dirname(_file_) DIRECTORY_SEPARATOR
  9. HUD 1541/BIT(数状数组)
  10. 4位开锁<dfs>