[Zope] Looking up other row records in an SQLMethod?

2000-08-15 Thread Theodore Patrick

Is it possible to look up other SQL record values while iterating through a
DTML-IN?

Sample Data returned by SQL Method:

ID, ORDER
23, 1 
25, 3
34, 6
39, 19
12, 23

Using a DTML IN I need to get the following during a single pass through
the SqlMethod:

HEADER ID   ORDER  PREV  NEXT
PASS 1   231null3
PASS 2   253  1 6
PASS 2   256  319
PASS 2   25   19 623
PASS 2   25   2319   null

Calculating the PREV and NEXT is the problem and this cannot be done via
SQL.

1. What is the syntax for writing out SQL Fields Directly?

Say in a DTML-IN

dtml-var ID  dtml-var ORDER dtml-var "ORDER[0]" dtml-var "ORDER[2]


Any Ideas??

Thanks in Advance.

Theodore E. Patrick
Ishophere.com



___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] Looking up other row records in an SQLMethod?

2000-08-15 Thread Dieter Maurer

Theodore Patrick writes:
  Is it possible to look up other SQL record values while iterating through a
  DTML-IN?
I did not understand your requirements.

But the answer is yes:

dtml-let query_results=SQLMethod
  dtml-in query_results

dtml-var "query_results[i].field"
  !-- this will access "field" of the i-th row--
...
  /dtml-in
/dtml-let


Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
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 )