[DB-SIG] Re: How to handle database warnings ?

Federico Di Gregorio fog@mixadlive.com
24 Jul 2001 12:10:58 +0200


On 24 Jul 2001 10:37:50 +0200, M.-A. Lemburg wrote:
> John Shafaee wrote:
> > 
> > I am personally in favor of clearing the list after each call to execute(). This
> > allows the programmer ample opportunity to make note of the list contents if so
> > desired. The semantics of clearing after a call to execute() is also more clear
> > and intuitive. You can optionally add an extra method that can be used to flush
> > the error/warning queue on demand.
> 
> Are you sure that you want to clear the list *after* the call and
> not before processing it ?

imho, this was a typo. the list should be cleared before: if you clear
it after, how can the user know what happened during the .execute()?

> Also what is your rational for only doing this for the .execute()
> calls and not the .fetch() calls ?

maybe the user wants to cycle over a bunch of .fetchone() and simply
collect all the warnings at the end. also, usually most of the work (and
the warnings) are in the execute...

--
Federico Di Gregorio
MIXAD LIVE Chief of Research & Technology              fog@mixadlive.com
Debian GNU/Linux Developer & Italian Press Contact        fog@debian.org
  All'inizio ho scritto un programma proprietario, in esclusiva per il
   cliente; e mi ha succhiato un pezzo di
   anima.                                           -- Alessandro Rubini