[Zope] Freeing ZSQL result sets?
Dieter Maurer
dieter@handshake.de
Mon, 14 Jul 2003 00:37:40 +0200
zoper@disturbance.dhs.org wrote at 2003-7-11 09:11 -0700:
> How does one free ZSQL result sets?
They are freed automatically. Nothing needs to be done.
> 1. Do some logic in DTML and set some REQUEST vars which will be used in a
> query.
>
> 2. Run the query and do a dtml-in loop over it
>
> 3. In DTML, some more logic, which if a certain condition exists will
> re-set the REQUEST vars set in step 1 to new values
>
> 4. Run the query again and loop through it using dtml-in
>
> Step 4 breaks, presumably because it is still the same query instance as
> the first and the cursor is at the end of the set...? What is the
> appropriate way to handle this situation?
When you call the ZSQL Method again (this may happen implicitely in DTML),
the query is newly executed and the cursor is placed at the start
of the new quere result.
> ...
Dieter