[Qt-interest] qtsql simultaneous queries to db

franki franki at franki.eu.org
Fri Feb 12 14:49:13 CET 2010


Thursday 11 of February 2010 17:54:18 Will Rutherdale (rutherw) napisał(a):
> My understanding is that you would want another QSqlQuery for that
> purpose.
>
> On the other hand if you want to control database connections and
> transactions, then you can create one QSqlDatabase object and attach all
> your QSqlQuery objects to that one database object.  For instance:
>
> QSqlDatabase qdb;
>
> QSqlQuery q0( qdb );
> QSqlQuery q1( qdb );

so that's what I did. And it work's like it should.
Thanks for all answers.

Marek


>
> -Will
>
> > -----Original Message-----
> > From: qt-interest-bounces at trolltech.com
> > [mailto:qt-interest-bounces at trolltech.com] On Behalf Of franki
> > Sent: 11 February 2010 11:15
> > To: QT Mailing LIST
> > Subject: [Qt-interest] qtsql simultaneous queries to db
> >
> > Hi,
> >
> > I need to run another query, during fetching result from
> > QSqlQuery, something
> > like this:
> >
> > q=QSqlQuery;
> > q.exec("select somethig from table");
> > while(q.next()) {
> > 	// need run another query to calculate some values
> > 	//....
> > }
> >
> > Is it possible with one connection to db? For example to
> > create another
> > QSqlQuery object and call q1.exec() and so one, during
> > reading from previous
> > QSqlQuery?
> > Or do I need separate connections to run simultaneously queries?
> >
> > I have qt4.5 and postgresql 8.1
> >
> > Greetings
> > Marek
> > _______________________________________________
> > Qt-interest mailing list
> > Qt-interest at trolltech.com
> > http://lists.trolltech.com/mailman/listinfo/qt-interest
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list