[Qt-interest] Incomprehensible SQL errors
Scott Aron Bloom
Scott.Bloom at onshorecs.com
Tue Nov 15 18:16:48 CET 2011
You are most likely either only doing an exec on the query string
QSqlQuery::exec( select )
Or are not checking the results of the prepare statement...
QSqlQuery.prepare( "select...." )
Whats happening, is the statement is failing to process, so when you go
to execute it, there are no parameters to bind to.. thus the message.
Check last eerror after the prepare
Scott
From: qt-interest-bounces+scott.bloom=onshorecs.com at qt.nokia.com
[mailto:qt-interest-bounces+scott.bloom=onshorecs.com at qt.nokia.com] On
Behalf Of Ruth Morrison
Sent: Monday, November 14, 2011 10:12 PM
To: Qt-Interest
Subject: [Qt-interest] Incomprehensible SQL errors
I had a QSqlQuery that was malformed - it had a stray closing
parenthesis on the end. When it tried to execute at run-time, the call
to lastError () returned "Parameter count mismatch". This was not a
QSqlQuery that had been previously used for other queries and then
finish()ed. Running the same malformed query in the SQLite 3
interpreter produces the correct error ("Error: near ")": syntax
error"). Why does lastError () return "Parameter count mismatch"? Is
that just the default error for when it can't figure out what went
wrong?
EK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20111115/c44477a6/attachment.html
More information about the Qt-interest-old
mailing list