[Qt-interest] QSqlQuery::numRowsAffected

Scott Aron Bloom Scott.Bloom at sabgroup.com
Fri Jun 26 22:12:00 CEST 2009


> On Friday 26 June 2009 2:01:49 pm Scott Aron Bloom wrote:
> > Have you checked the driver has the feature QSqlDriver::QuerySize?
> Yes, it does.  I use it all over the place...
Figured you had checked.. but always good to check the obvious...

> > I have found in the past, that even when it says it does, it only
does
> > in some cases.  I don't know postgres's C/C++ interface well enough,
but
> > that is the case with the MS SQL interface...
> >
> >
> > This could be  abug in the QT Driver code (build and run the debug
> > version and take a look at the source and see) or it could be in the
> > PostGres sql C++ code
> 
> While I've developed against libpq on many occasions, I've never
before
> encountered this scenario ...  so as you suggest, it could very well
be in the
> underlying libpq...
> 
Honestly.. probably not.. The only reason I say this, the drivers, while
being very good, are not perfect..

In order to fully access and use the underlying libpq properly, you
would almost have to be an expert in libpq, and its very possible that
the TT developers just missed a corner case in the QSqlDriver

> I haven't dug into Qt or postgres code regarding the matter.  I was
hoping to
> leverage community knowledge :-)
> 
> It seems obvious to me that for this type of query (both
update/insert/delete
> & returns records), that QSqlQuery::numRowsAffected & QSqlQuery::size
would
> return valid & correct results.
> Maybe I'll take up that cause when I get enough time to at least come
up for
> air :-)

Good luck... air is always good... :)
> 
> Thanks,
> -Rick

Wish I could have been more help.

Scott





More information about the Qt-interest-old mailing list