Hi everyone,
So basically, I've been have some problems with QSQL code so i tested it with both the mysql driver and postgresql driver. It works perfectly with the mysql database however when i run the same thing with the postgresql driver i get the following error. And I have to use postgresql it's for my senior project
QPSQL: Unable to create query"
query failed: "ERROR: syntax error at or near "("
LINE 1: EXECUTE ('Don''t Say No', '21:03', 'Twenty One O Three', '/..
^
QPSQL: Unable to create query"
query failed: "ERROR: syntax error at or near "("
LINE 1: EXECUTE ('Don''t Say No', '21:03', 'Twenty One O Three', '/..
^
To copy to clipboard, switch view to plain text mode
I don't know where that EXECUTE command comes from, and i check the error log on the server and the same query shows when i'm doing an INSERT
has an anyone seen this before ??
thanks in advance
QSqlQuery query
("INSERT INTO tracks (title, artist, album, path, duration) VALUES ( ?, ?, ?, ?, ? )");
query.
addBindValue(QString(f.
tag()->title
().
toCString()));
query.
addBindValue(QString(f.
tag()->artist
().
toCString()));
query.
addBindValue(QString(f.
tag()->album
().
toCString()));
query.addBindValue(it.filePath());
query.
addBindValue(QString(f.
audioProperties()->length
()));
if(query.exec()) {
qDebug() << query.lastQuery();
} else {
qDebug() << "query failed: " << query.lastError().text();
}
QSqlQuery query("INSERT INTO tracks (title, artist, album, path, duration) VALUES ( ?, ?, ?, ?, ? )");
query.addBindValue(QString(f.tag()->title().toCString()));
query.addBindValue(QString(f.tag()->artist().toCString()));
query.addBindValue(QString(f.tag()->album().toCString()));
query.addBindValue(it.filePath());
query.addBindValue(QString(f.audioProperties()->length()));
if(query.exec()) {
qDebug() << query.lastQuery();
} else {
qDebug() << "query failed: " << query.lastError().text();
}
To copy to clipboard, switch view to plain text mode
Bookmarks