Am 24.10.22 um 19:58 schrieb Till Oliver Knoll:
However when compiled into my Qt 5.15.2 application with some current
"test code" like:.
QSqlQueryquery1;
query1.setForwardOnly(true);
query1.prepare(
"selectpower(l.latitude-48.0,2)+power((l.longitude-8.0)*cos(radians(48.0)),2)dist"
"from location l;"
);
constboolsuccess=query1.exec();
if(success){
...
}else{
qDebug()<<"SQL error:"<<query1.lastError().text()<<"- error
code:"<<query1.lastError().nativeErrorCode();
}
I get:
SQL error: "No query Unable to fetch row" - error code: ""
Just for the record: if I add the following "test code" to my own
application:
QSqlQuery query1("select power(5, 2);"); ... ... <<
query1.lastError().text();
then I also get:
SQL error: "no such function: power Unable to execute statement" - error
code: "1"
So it seems that when trying to generate a prepared statement the error
message is different - but the root cause seems to be the same: "no math
functions" available.
Cheers, Oliver
_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest