[Qt-interest] Incomprehensible SQL errors

Ruth Morrison dragonflykes at gmail.com
Tue Nov 15 22:03:54 CET 2011


That does make sense.  Although, lastQuery () does return the malformed
query, complete with ? for the named parameter I used.

On Tue, Nov 15, 2011 at 9:16 AM, Scott Aron Bloom <Scott.Bloom at onshorecs.com
> wrote:

> 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****
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20111115/8d0c9aa7/attachment.html 


More information about the Qt-interest-old mailing list