Hello!
Facts:
SQLite3-Database -> created by myself
used driver -> QSQLITE
connection -> ok, because statments before and after the problem are working fine

What do I do:
I try to delete some data, which doesn't fit into my regular expression

Qt Code:
  1. #include <QRegExp>
  2. #include <QSqlError>
  3. #include <QString>
  4. #include <QStringList>
  5. #include <QSqlQueryModel>
  6. #include <QSqlRecord>
  7. #include "cb_database/cb_database.h"
  8.  
  9. #define DB_NMEA "nmea"
  10. ...
  11.  
  12. cb_database db; //Class which handles a SQLite3-Database
  13. db.open("xyz.db"); //Path to database
  14. QRegExp dateFormat;
  15. QRegExp timeFormat;
  16.  
  17. //Format of a correct date -> ddmmyy
  18. dateFormat.setPattern("([0][1-9]|[1-2][0-9]|[3][0-1])"
  19. "([0][1-9]|[1][0-2])[0-9]{2}");
  20. //Format of a correct time -> hhmmss.00
  21. timeFormat.setPattern("([0-1][0-9]|[2][0-3])([0-5][0-9]){2}\\.[0]{2}");
  22.  
  23. QString reg;
  24. reg=QObject::tr("DELETE FROM %0 WHERE "
  25. "(time REGEXP '%1')=0 "
  26. "OR (date REGEXP '%2')=0 "
  27. "OR date='010680'")
  28. .arg(DB_NMEA)
  29. .arg(timeFormat.pattern()).arg(dateFormat.pattern());
  30. db.query(reg);
  31. test=db.lastQuery();
  32. qDebug() << test->lastError();
  33. qDebug() << reg;
  34. ...
To copy to clipboard, switch view to plain text mode 

Problem:
The statement seems to be correct, because I have tested this one with a opensource SQLite-Database-browser. I happens exactly what I expected. But when I try the same statement in my Qt-Application, nothing happens. The count of the rows in the table doesn't change. So the Problem must be in the code or maybe QSQLite-Driver.

Result:
qDebug Statement-> "DELETE FROM nmea WHERE (time REGEXP '([0-1][0-9]|[2][0-3])([0-5][0-9]){2}\.[0]{2}')=0 OR (date REGEXP '([0][1-9]|[1-2][0-9]|[3][0-1])([0][1-9]|[1][0-2])[0-9]{2}')=0 OR date='010680'"
qDebug ERROR -> QSqlError(1, "Unable to execute statement", "no such function: REGEXP")

The Error shows that the function I use doesn't exist, but the documentation says that it exists.

Question:
Does somebody has an idea what to do now?