[Zope] Variable as record type or dictionary
Tino Wildenhain
tino@wildenhain.de
Mon, 03 Apr 2000 00:24:02 +0200
Hi Juan,
ZSQL methods are cached. So you need not copy them to a variable.
Siply call it first:
<dtml-call "Client(client_num='2345')">
and use it later with
<dtml-in "Client(client_num='2345')">
...
</dtml-in>
Or did I miss something obvious?
HTH
Tino Wildenhain
Juan Carlos Coruņa wrote:
>
> Hi Zopists!
>
> I need to copy a record from into a <dtml-in> tag to use it later.
>
> Suppose:
>
> "Client" is a select ZSQL method (select * from Client where <dtml-sqltest
> client_num type=string>).
> ----
> <dtml-in "Client(client_num='2345')">
> copy the retrieved record in a variable
> </dtml-in>
> ----
> "OrderLine" is a insert ZSQL method:
>
> insert into OrderLine
> (order_num,client_num,client_name,client_address,...,product_num,...)
> values
> (<dtml-sqlvar order_num type=string>,
> insert the column "client_num" from the previous retrieved Client record,
> insert the column "client_name" from the previous retrieved Client
> record,
> insert the column "client_address" from the previous retrieved Client
> record,
> ...,
> <dtml-sqlvar product_num type=string>,
> ...)
> ----
> Registering the order lines...
> <dtml-call "OrderLine(order_num='OR4567',product_num='PENCIL-0067')">
> <dtml-call "OrderLine(order_num='OR4568',product_num='PEN-BLUE-8')">
> <dtml-call "OrderLine(order_num='OR4569',product_num='PENCIL-0045')">
> <dtml-call "OrderLine(order_num='OR4570',product_num='PENCIL-0023')">
> <dtml-call "OrderLine(order_num='OR4571',product_num='PEN-BLCK-1')">
> <dtml-call "OrderLine(order_num='OR4572',product_num='PEN-031')">
>
> ----
>
> Take in mind that I can't put the ZSQL method "Client" inside the ZSQL
> method "OrderLine" because the Client method needs about 10 seconds to
> execute and if every "OrderLine" method needs his time plus 10 seconds (from
> the "Client" method) this can take over one minute for the above example
> order. This is not viable! Awaiting 15 seconds to place the order is
> acceptable but over one minute isn't.
>
> The solution is to execute the "Client" method only one time. Any ideas how
> can I copy the Client record?
>
> Juan Carlos Coruņa.
>
> _______________________________________________
> Zope maillist - Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )