[DB-SIG] There is a better way
Stuart Bishop
zen@shangri-la.dropbear.id.au
Wed, 12 Jun 2002 16:22:03 +1000
On Friday, June 7, 2002, at 08:34 PM, Richard Taylor wrote:
> if cr.description == None or cr.rowcount == 0 :
> return []
>
> try:
> res = cr.fetchall()
> I would welcome comments on whether this will work on all DB API
> modules.
Unfortunatly, rowcount may be undefined until all results have been
retrieved (otherwise the DB may have to execute some massive query
twice -
once to determine the rowcount and once to actually retrieve the rows -
in cases where the result cannot be cached in memory).
--
Stuart Bishop <zen@shangri-la.dropbear.id.au>
http://shangri-la.dropbear.id.au/