脚本如下:
#!/usr/bin/env python # -*- coding: utf-8 -*- import sqlite3 def dataMerge(inpath,attachpath): conn = sqlite3.connect(inpath) conn.text_factory = str cur = conn.cursor() attach = 'attach database "'+attachpath+'" as w;' sql1 = 'insert into map select * from w.map;' sql2 = 'insert into images select * from w.images;' cur.execute(attach) cur.execute(sql1) cur.execute(sql2)
查看原文:http://www.giser.net/?p=1339
使用python合并两个sqlite数据库
最新推荐文章于 2024-08-09 16:35:32 发布