Am Wed, 11 Mar 2015 10:29:41 +0100
schrieb Guido Seifert <warg...@gmx.de>:

> 
> > works at my side, qt4.8.6:
> >   query.prepare("CREATE TEMP TABLE selectseriestable AS SELECT title FROM 
> > titlegroup,title "
> >     "WHERE titlegroup.seriesID=(SELECT seriesid FROM series WHERE 
> > series=:series AND version=:version) AND 
> > titlegroup.titleID=title.titleID;");
> >   QString series="bla";
> >   QString version="blabla";
> >   query.bindValue(":series",series);
> >   query.bindValue(":version",version);
> > 
> > besides that my ms sql server don't like the syntax...
> 
> There is an alternative syntax for the same goal using SELECT INTO... Does 
> not work for me either. Exactly the same problem. 
> 
> > in my case the QSqlQuery emulates preparing and binding, but the query is 
> > prepared successfully and the values are bound. and the 
> > statement is executed by the sql server.
> 
> Maybe a problem of the postgresql driver. 

you can try to debug into the driver and see what happens, e.g. stepping into 
the QSqlQuery::exec(). this way you could verify that it's either the driver or 
the database.

perhaps a postgres user can give more informations, when you provide the 
QSqlError::text() from the failing statement.

> > i think in view of the drivers theres no difference in the exact statement, 
> > whether you have a insert, create, whatever, 
> > is of no concern.
> 
> That's what I thought, too. But neither CREATE TEMP TABLE... AS SELECT nor 
> SELECT * INTO .... FROM works for me if I use
> bound values. Those statement are the only, which give me this trouble. And 
> since you say it works for you on qt4.8.6 and it works
> for me if I remove the bound values, I doubt it is a bug on my side.
> 
> Fortunately it is not a show stopper for me. Though the workaround looks a 
> but ugly. 
> 
> Thanks for trying.
> 
> Guido
> _______________________________________________
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

alex

-- 
/*
 *  Q:  Why don't Scotsmen ever have coffee the way they like it?
 *  A:  Well, they like it with two lumps of sugar.  If they drink
 *    it at home, they only take one, and if they drink it while
 *    visiting, they always take three.
 */

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to