I am trying to run this query to SQlite database but its not executing from Qt
but when I go to navicat and execute the same query it works very fine with no problems
QSqlQuery query;
query.prepare("SELECT token FROM tokens WHERE SOUNDEX(token) = SOUNDEX('search')");
if(!query.exec()){
QMessageBox::information(this,"Error","query won't execute"); //will be displayed
}
QSqlRecord rec = query.record();
int cols = rec.count(); //0
where if I executed any other select stamement it works very fine
The problem is that the
SOUNDEXalgorithm is disabled by default and you have to use the compiler flag-DSQLITE_SOUNDEX=1when buildingsqlite.So you have to build the
sqlitedriver with this flag on, and then build the plugin by linking it to yoursqlitebuild.