[Zope] Freeing ZSQL result sets?

zoper@disturbance.dhs.org zoper@disturbance.dhs.org
Fri, 11 Jul 2003 09:11:29 -0700 (PDT)


Greetings:

How does one free ZSQL result sets? Here's the outline of my situation:

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? Currently, I end up duplicating
the query exactly into a new query with a unique name. I actually end up
hitting that query 4 times in one page, so I have ZSQL methods eg query1,
query2, query3, query4, all with identical SQL in them.

I imagine I am missing something obvious... thanks for any anwers.

Bryan