[Interest] Is chaining of multiple SQL statements with bound values possible?

Constantin Makshin cmakshin at gmail.com
Mon Mar 16 21:48:45 CET 2015


Are you sure the backend supports preparing of combined statements? If it
does, then the best way to find the source of the problem would be running
your program under the debugger and stepping into QtSql internals.
On Mar 16, 2015 6:05 PM, "Guido Seifert" <wargand at gmx.de> wrote:

> Hi,
> my problem:
>
> When I combine two sql statement in one QSqlQuery:
> query("SELECT * FROM foo; SELECT * FROM bar");
> it works ok.
>
> But this does not seem to work when the statements have different bound
> values:
>
> query("SELECT * from foo WHERE name=:foo"; SELECT * from bar WHERE
> name=:bar");
> query.bindValue(":foo",xxx);
> query.bindValue(":bar",yyy);
>
> I always get an unspecified syntax error. The statement without the bound
> values works fine.
>
> Any ideas?
>
> Guido
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150316/45ed0652/attachment.html>


More information about the Interest mailing list