[Qt-interest] qtsql simultaneous queries to db

Will Rutherdale (rutherw) rutherw at cisco.com
Thu Feb 11 17:54:18 CET 2010


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
> 




More information about the Qt-interest-old mailing list