In PyQt4 I create a QSqlDatabase
like
slpath = 'path/to/my/db.sqlite'
db = QSqlDatabase.addDatabase('QSPATIALITE')
db.setDatabaseName(slpath)
This seem to work. Now I try to UPDATE
a table layer_styles
as follows:
query = QSqlQuery(db) #db cp. above
query.prepare("UPDATE layer_styles SET f_table_catalog=:path;")
query.bindValue(":path", slpath)
query.exec_()
But the query.prepare(...)
returns false
. What am I doing wrong?