iOS 数据库主键重复,依然可以插入

+ (void)insertWithSetKeyName:(NSString *)keyName Value:(NSString *)value;
{
    [self open];
   
    NSString * sql = [NSString stringWithFormat:@"insert or ignore into PTBBSet values ('%@', '%@')", keyName, value];

    sqlite3_exec(dbPoint, sql.UTF8String, NULL, NULL, NULL);
   
}
 
posted @ 2015-09-24 12:37  逆时光  阅读(306)  评论(0编辑  收藏  举报