[DB-SIG] There is a better way

Richard Taylor r.taylor@eris.qinetiq.com
Wed, 12 Jun 2002 10:34:36 +0100


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 12 June 2002 10:22 am, M.-A. Lemburg wrote:
> Richard Taylor wrote:
>> [snip]
> >
> > i.e.
> >
> >  if cr.description == None or cr.rowcount == 0 :
> >        return []
>
> Don't know why you test .description here. cr.rowcount should suffice.

The reason for checking .description is that I want to be sure that an 
exception raised from fetchXXX is because an error has occurred rather than 
no rows to return. And I want this to be the case regardless of the type of 
query that has been passed to execute(). The check of .description (I think) 
is the only way to be sure that a 'select' type query has been passed to 
execute().

The background to this is in the "[DB-SIG] Is there a better way of doing 
this?" thread from last week.

Richard

- -- 
QinetiQ                                  
B105 Woodward Building
St. Andrews Road
Malvern
Worcs WR14 3PS

The Information contained in this E-Mail and any subsequent correspondence
 is private and is intended solely for the intended recipient(s).
 For those other than the recipient any disclosure, copying, distribution, 
or any action taken or omitted to be taken in reliance on such information is
 prohibited and may be unlawful.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9BxWs7Z7YaKfan9kRAnazAJ9ge9OB2W5VvBWAaDSNtBitkQX0CQCeM2nE
2PC4NvvwpZBw1S72N42ETlA=
=9h7T
-----END PGP SIGNATURE-----