lundi 29 février 2016

QT Sqlite UPDATE statement prepare error

I am trying to prepare a SQL statement using QT's built-in Sqlite engine.

The following statement:

UPDATE collections SET collection_type=:v1 WHERE 
(collections.collection_name = 'asfg')

fails in QSqlQuery's prepare statement (prepare returns false).

QSqlError err = db.lastError(); gives no error message...

However if I execute the same statement (by replacing :v1 with a number) in the sqlite prompt it succeeds.

What am I doing wrongly?

Aucun commentaire:

Enregistrer un commentaire