[Zope] Problem with nested Z SQL Methods

Thomas B. Passin tpassin@mitretek.org
Thu, 25 Oct 2001 12:44:32 -0400


Your problem is not with nesting two sql requests but in tryuing to nest one
<dtml-va> within another.  This is not allowed.  This ought to work, though:

   <dtml-in "Database.sqlGetResults(tid=TID>)" >

After all, you already are able to display TID, right?  So its value is
available when the second call is made.

Cheers,

Tom P


[Krone, Armin]

> I try to do two nested Database requests. In the outer lop there is
selected
> all the merchants transactions and in the inner loop there shall be
> displayed the possible (0..n) Results. The TID shall be taken from from
the
> outer loop.
> This fails with an syntax error. If I set in '<dtml-in
> expr="Database.sqlGetResults(tid='123')" >' instead it works (but the
inner
> loop gets the wrong data - for shure).
>
> How can i nest this 2 Z SLQ Methods correct?
>
>
> <dtml-var standard_html_header>
> <h2><dtml-var title_or_id> <dtml-var document_title></h2>
> <p>
> <table border=1>
>  <tr>
>   <th>TID</th>
>   <th>CURRENCY</th>
>   <th>AMOUNT</th>
>   <th>AMOUNTWITHOUTDECIMALS</th>
>   <th>BASKET</th>
>   <th>CARDNUMBER</th>
>   <th>CARDEXPIRY</th>
>   <th>USERID</th>
>   <th>PAYMETHOD</th>
>   <th>MERCHANTTID</th>
>   <th>MERCHANTADDITIONALDATA</th>
>
>  </tr>
>  <dtml-in
>
expr="Database.sqlGetTransactionMerchant(merchantid=_.SecurityGetUser().getU
> serName())" >
>  <tr>
>   <td><dtml-var TID></td>
>   <td><dtml-var CURRENCY ></td>
>   <td><dtml-var AMOUNT ></td>
>   <td><dtml-var AMOUNTWITHOUTDECIMALS ></td>
>   <td><dtml-var BASKET ></td>
>   <td><dtml-var CARDNUMBER ></td>
>   <td><dtml-var CARDEXPIRY ></td>
>   <td><dtml-var USERID ></td>
>   <td><dtml-var PAYMETHOD ></td>
>   <td><dtml-var MERCHANTTID ></td>
>   <td><dtml-var MERCHANTADDITIONALDATA ></td>
>
>  </tr>
>    <dtml-in expr="Database.sqlGetResults(tid=<dtml-var TID>)" >