Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Problems using sql bindvalue in QT 5.1



  • the code below works in qt 4.8
    @
    QSqlQuery query(db);
    qint32 id = 1;
    query.prepare(QString("SELECT image_id, name FROM backgrounds WHERE id = :id"));
    query.bindValue("id", id);
    query.exec();
    @

    the “query.executedQuery()” return “SELECT image_id, name FROM backgrounds WHERE id = ?”
    instead "SELECT image_id, name FROM backgrounds WHERE id = 1"


  • Lifetime Qt Champion

    Hi,

    This sounds like a bug, did you check the "bug report system":bugreports.qt-project.org/issues/ ?

    If nothing's there you can try to ask on the interest mailing list, you'll find Qt's developers/maintainers there (this forum is more user oriented) and maybe open a bug report (don't forget to add you OS, Qt versions etc...)


Log in to reply