![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
sqlite3
mz_老张
这个作者很懒,什么都没留下…
展开
-
C++ sqlite3 0x00007FF9DA42F621 (ucrtbased.dll)处(位于 TestSqlite.exe 中)引发的异常: 0xC0000005: 读取位置 0x000000
最近使用C++ Sqlite3,通过回调函数获取查询的结果时报的错。搞了一上午不知道什么情况,后来发现是因为创建sqlite3时没有创建自增主键id,而sqlite3自动创建了一个id字段,但是该id不是必须存在自增的,所以返回null.导致通过column_value[i]获取值时报的错误。sqlite3创建自增主键id语句string createsql = "create table if not exists dtable (id INTEGER PRIMARY KEY AUTOINCR原创 2022-05-04 13:54:13 · 2178 阅读 · 0 评论 -
python sqlite3 有则更新,无则插入
python sqlite3 update 有则更新,无则插入表结构: sql = ''' create table if not exists task( id int primary key , cg_id varchar(200) not null, database varchar(100) not null, project varchar(100) not null, asset_s原创 2021-04-12 10:30:00 · 2906 阅读 · 1 评论 -
python sqlite3 模板
python sqlite3 模板import sqlite3class MZsqlite(object): def __init__(self,db_name,tb_name): super(MZsqlite, self).__init__() self.db_name=db_name self.tb_name=tb_name def init_sqlite(self): """ 初始化数据库原创 2020-09-19 12:19:44 · 196 阅读 · 0 评论 -
关于python sqlite3 存入json格式问题
一句话,sqlite3是支持json格式的,在创建表时,直接声明该字段为json即可。比如:sql="create table if not exists {}(id integer primary key autoincrement,cpt json,mm json,efx json)".format('workhour')...原创 2019-08-20 16:08:28 · 5044 阅读 · 0 评论