lundi 31 octobre 2016

QSqlQuery placeholder for table

Here is says placeholders do not work for table name. Why?

QSqlQuery query(db);
qDebug() << query.prepare("SELECT :parameter FROM :table");
query.bindValue(":parameter", parameter);
query.bindValue(":table", table);

How to overcome that issue?

Aucun commentaire:

Enregistrer un commentaire