[Zope] Passing arguments to secondary SQL query

Matthew Nelson mnelson@esperion.com
Tue, 29 May 2001 07:27:38 -0400


Greetings,

I am generating a report based on a SQL query, say query1.  Using dtml-in it
iterates over each returned row.  Within each row, I would like to create a
table based on a second query, say query2.  Everything works great until I
insert query2 in a second dtml-in statement.  I can't figure out how to pass
query2 arguments, which are dtml-vars from the current loop of query1.  I
get the error: Bad Request, Error Value: ['var1'].  Here's a simplified
example:

query1:  select var1 from mytab;
query2:  select newvar from mytab2 where myvar = <dtml-sqlvar var1
type="string">;

Report:
<dtml-in query1>
  <dtml-var var1><br>
  <dtml-in query2>    <!-- Here's where I'm stuck -->
    <dtml-var newvar><br>
  </dtml-in>
</dtml-in>

Thanks a bundle in advance for any suggestions.

Regards,

Matt Nelson
Esperion Therapeutics, Inc.