一开始 一直不明白,主键自动增长sqlite里面是如何插入的

来源:互联网 发布:改号任意显源码 编辑:程序博客网 时间:2024/05/01 09:31

后来发现,只要不写这个字段,或者这个字段插入的是NULL就行。注意:是NULL,不是字符串,也不是对象。


不管代码中有没有是否为空的限制,只要在用navicat 打开的时候,没有 notnull的限制就行。否则,还是插不进去的。

[db executeUpdate:@"INSERT INTO custom1013(id,sys_id,status_id,custom_id,modifydate,reserve1,reserve2,remark,update_sales,created_at,updated_at,seller_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?) ",NULL,@"001",@"0",@"001",modifydate,groupTitle,@"0",@"remark",@"33",created_at,updated_at,@"20"];

id是主键。

0 0
原创粉丝点击