Hi all! I have the following code to manipulate a sqlite3 database:

Qt Code:
  1. const QString SQL_INSERT_LANGUAGE =
  2. "INSERT INTO languages VALUES ("
  3. "null, :language, :abbreviation"
  4. ")";
  5.  
  6. const QString SQL_CREATE_TABLE_WORD =
  7. "CREATE TABLE :table ("
  8. "word VARCHAR UNIQUE, "
  9. "a INT, b INT, c INT, d INT, e INT, f INT, g INT, h INT, "
  10. "i INT, j INT, k INT, l INT, m INT, n INT, o INT, p INT, "
  11. "q INT, r INT, s INT, t INT, u INT, v INT, w INT, x INT, "
  12. "y INT, z INT, "
  13. "len INT"
  14. ")";
  15.  
  16. bool DB::addLanguage(const QVariant & language, const QVariant & abbreviation)
  17. {
  18. QSqlQuery query((*mDatabase));
  19.  
  20. query.prepare(SQL_INSERT_LANGUAGE);
  21. query.bindValue(":language", language);
  22. query.bindValue(":abbreviation", abbreviation);
  23.  
  24. if (query.exec() == false) {
  25. qDebug() << "ERROR 1 = " << query.lastError();
  26.  
  27. return false;
  28. }
  29.  
  30.  
  31. query.prepare(SQL_CREATE_TABLE_WORD);
  32. query.bindValue(":table", abbreviation);
  33.  
  34. if (query.exec() == false) { // The error is in this query
  35. qDebug() << "ERROR 2 = " << query.lastError();
  36. qDebug() << "SQL = " << query.executedQuery();
  37.  
  38. return false;
  39. }
  40.  
  41. return true;
  42. }
To copy to clipboard, switch view to plain text mode 

The first query executes with no problem. But when the second one is executed it give me the "Parameter count mismatch".

Please, can someone help me???

Thanks!!!