[Zope-DB] Problems using multiple DB reads using a parameter

Maszerowski, Thomas TMaszerowski@crt.xerox.com
Wed, 26 Feb 2003 14:53:56 -0500

I building a simple report that need an owner ID (integer) in order to use a
WHERE on a SELECT statement. Since my reporting needs aren't complex, I let
Zope build the report using a Z Search Interface. I have a separate form
that gets the ownerID value. The head of the report looks like this:

<dtml-var standard_html_header>
<h2><dtml-var title_or_id> <dtml-var document_title></h2>
<dtml-in selectByOwnerID size=20 start=query_start>
   <dtml-if sequence-start>

      <dtml-if previous-sequence>

        <a href="<dtml-var URL><dtml-var sequence-query
        (Previous <dtml-var previous-sequence-size> results)

The selectByOwnerID looks like this (ownerID is an argument to the method):

SELECT tblLookupPersonnel.txtName, tblActions.*
FROM tblActions LEFT JOIN tblLookupPersonnel
ON tblActions.lngActoneerID = tblLookupPersonnel.lngPersonnelID
WHERE tblActions.lngActoneerID = <dtml-sqlvar ownerID type=int>

So far so good. The report creates tables of 20 records and then you can
choose to display subsequent pages. It works fine on the first page, but
always gives a "missing input variable, ownerID" instead of the second page.
Why does it work the first time and not the second?



Tom Maszerowski
Xerox Innovation Group/Xerox Engineering Center
MS: 105-70C
Phone (585) 422-1579
Fax (585) 422-2837
This e-mail message, including any attachments, is for the sole use of the
intended recipient(s) and may contain confidential information.  Any
unauthorized review, use, disclosure or distribution is prohibited.  If you
are not the intended recipient(s) please contact the sender by reply e-mail
and destroy all copies of the original message.  Thank you.