[Qt-interest] qtsql simultaneous queries to db

KC Jones kc at asperasoft.com
Thu Feb 11 18:32:55 CET 2010


The other thing to note is that even if you use a separate QSqlQuery object
for the inner request, the nested query actions will not post to the db
until the outer query is closed/completed.   The outer query is effectively
a transaction.

On Thu, Feb 11, 2010 at 8:54 AM, Will Rutherdale (rutherw) <
rutherw at cisco.com> wrote:

> 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 );
>
> -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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100211/7fa3f6cc/attachment.html 


More information about the Qt-interest-old mailing list