Important: Please read the Qt Code of Conduct -

SQLite " Parameter count mismatch"

  • I am trying to run a simple select on the SQLite db. However i am getting the above mentioned error : " Parameter count mismatch

    bool DbLite::import(QString filename)
        QSqlQuery query(mDb);
        query.prepare(".import :filename bisdata");
            qDebug() << "SQLite : " << query.lastError().text();
            return false;
            return true;

    And this is how i am calling it.

            qDebug() << "Import Successfull";

    My Output :

    SQLite :  " Parameter count mismatch"

    I also tried

        query.prepare(".import ? bisdata");

    I Still get the same error.

  • The .import statement is not a Sql Statement.

    The (.) dot commands are only for use inside the sqlite application.

    The recommended way to import data into the database is the usage of the sqlite3 backup api.

    (see: )

Log in to reply