[Qt-interest] QSqlQuery::numRowsAffected

Scott Aron Bloom Scott.Bloom at sabgroup.com
Fri Jun 26 21:01:49 CEST 2009


Have you checked the driver has the feature QSqlDriver::QuerySize?

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

Scott

> -----Original Message-----
> From: qt-interest-bounces at trolltech.com [mailto:qt-interest-
> bounces at trolltech.com] On Behalf Of Rick Vernam
> Sent: Friday, June 26, 2009 11:55 AM
> To: qt-interest at trolltech.com
> Subject: Re: [Qt-interest] QSqlQuery::numRowsAffected
> 
> On Monday 22 June 2009 3:20:04 pm Rick Vernam wrote:
> > I have very simple update query, which also returns data.
> > In Postgres' psql, I run:
> > update sometable set somefield = somevalue where
somecriteria=whatever
> > returning someothervalue;
> >
> > When I run this query via the QPSQL driver, sometable.somefield is
indeed
> > updated to somevalue, however QSqlQuery::numRowsAffected returns
zero.
> >
> > If I run the query without the returning clause, then I get a valid
result
> > from QSqlQuery::numRowsAffected.
> >
> > So is this the expected behavior?
> >
> > Thanks,
> > -Rick
> 
> Nobody knows?
> 
> > _______________________________________________
> > 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