[DB-SIG] There is a better way
M.-A. Lemburg
mal@lemburg.com
Wed, 12 Jun 2002 11:22:23 +0200
Richard Taylor wrote:
>>A .rowcount of 0 always indicates that the result set is
>>empty. Unfortunately, some database drivers and interfaces
>>are broken in this respect (including some ODBC drivers
>>out there), so applications should be aware of this.
>
>
> So that means that the original code should work if the driver is not broken?
>
> i.e.
>
> if cr.description == None or cr.rowcount == 0 :
> return []
Don't know why you test .description here. cr.rowcount should suffice.
--
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Company & Consulting: http://www.egenix.com/
Python Software: http://www.egenix.com/files/python/
Meet us at EuroPython 2002: http://www.europython.org/