rowcount stores the number of rows that were located during an INSERT,
UPDATE, or DELETE statement, and is undefined during SELECT.  the
"length" of a result set is generally not known until it is completely
fetched, as the database typcially starts returning rows over the wire
before it has even finished locating all rows (unless the results were
ordered or otherwise grouped in some way).

to get the length of a particular result usually entails either fully
fetching the result, or calling a separate select of "count()" with the
same criterion.

George Sakkis wrote:
> I tried to get the length of a result set and I ran into the this
> error. While I understand that ResultProxy is modeled more like an
> iterator than a sequence, I introspected the proxy object and it turns
> out it has a 'rowcount' attribute which stores the expected length. Is
> there a reason why there's not a __len__ that returnes this rowcount ?
> 
> Thanks,
> George


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sqlalchemy
-~----------~----~----~----~------~----~------~--~---

Reply via email to