sqlite如何避免重复建表(获取已经存在的表)

找到已经存在的所有表,手动判断是否需要建表

SELECT name FROM SQLITE_MASTER WHERE type='table'ORDER BY name"

建表时sqlite自动判断:
create table if not exists nodetype(id integer PRIMARY KEY autoincrement,type int)

删除表示自动判断:

drop table if exists SysNotice

猜你喜欢

转载自www.cnblogs.com/dachuang/p/10254304.html
今日推荐