数据创建数据
CREATE TABLE IF NOT EXISTS ArpAudit (ID INTEGER PRIMARY KEY autoincrement NOT NULL,
UserName TEXT, LocalHost TEXT, OpenTime TEXT, EventAction TEXT,EventObject TEXT, EventHandling TEXT,
EventDescription TEXT, Event_outcomes TEXT, LogLevel TEXT,LogXml TEXT);
ArpAudit 是表名字
数据库操作 参考以下两个连接
https://blog.csdn.net/dyd850804/article/details/82352772
https://blog.csdn.net/zhaoweixing1989/article/details/19080593
数据库的基本操作
创建数据库
CREATE TABLE IF NOT EXISTS ArpAudit (ID INTEGER PRIMARY KEY autoincrement NOT NULL,
UserName TEXT, LocalHost TEXT, OpenTime TEXT, EventAction TEXT,EventObject TEXT, EventHandling TEXT,
EventDescription TEXT, Event_outcomes TEXT, LogLevel TEXT,LogXml TEXT);
删除数据中所有数据
delete from TableName; //清空数据
查看数据中所有 数据 (SysPerformanceAudit) 是表的名字
select * from SysPerformanceAudit;
数据库按照字段筛选
select * from SysPerformanceAudit WHERE OpenTime > '2019-01-01 10:00:00.000' AND OpenTime < '2019-01-01 10:10:39.000' order by OpenTime limit 30;
数据库插入
INSERT INTO SysPerformanceAudit (UserName,LocalHost,OpenTime,EventAction,EventObject,EventHandling,EventDescription,Event_outcomes,LogLevel,LogXml) VALUES ('9','8','2019-01-01 10:00:00','6','5','4','3','2','2','1')
基本常用的操作:
sqlite3 数据库名.db:打开数据库
.table:查看数据库下的表
.schema:查看建表语句