pyQGIS read sql script into database

from pyspatialite import dbapi2 as db
conn = db.connect('path_to_db.sqlite')
qry = open('path_to_sql_script.sql', 'r').read()
curs = conn.cursor()
curs.execute(qry)
conn.commit()
curs.close()
conn.close()

Leave a Reply

Your email address will not be published. Required fields are marked *


× 8 = forty