SQL METHODS - Obtaining ROW IDS in an <IN> STATEMENT
Here is the situation: I have a method called item_method. It contains SQL:SELECT that returns 10 rows of data. When I want to print this to a page in ZOPE. I use an <IN> Statement as follows. Currently the data set from the database does not return a row number, so I need Zope to make one up as it prints the HTML. The data set has two columns called this and that. I need the code that generates the <!--#var ?????? --> in the following code. <!--#in item_method size=10 start=query_start--> ROW_NUM= <!--#var ?????? --> THIS=<!--#var this -->, THAT=<!--#var that --> <!--#in --> As always - Thanks in Advance. Theodore E. Patrick http://www.ishophere.com Where do you shop?
At 8:20 am -0500 5/8/99, Theodore Patrick wrote:
Here is the situation:
I have a method called item_method. It contains SQL:SELECT that returns 10 rows of data. When I want to print this to a page in ZOPE. I use an <IN> Statement as follows. Currently the data set from the database does not return a row number, so I need Zope to make one up as it prints the HTML. The data set has two columns called this and that. I need the code that generates the <!--#var ?????? --> in the following code.
<!--#in item_method size=10 start=query_start--> ROW_NUM= <!--#var ?????? --> THIS=<!--#var this -->, THAT=<!--#var that --> <!--#in -->
Try <dtml-var sequence-index>, ie ROW_NUM=<!--#var sequence-index--> THIS= etc etc. hth tone ------ Dr Tony McDonald, FMCC, Networked Learning Environments Project http://nle.ncl.ac.uk/ The Medical School, Newcastle University Tel: +44 191 222 5888 Fingerprint: 3450 876D FA41 B926 D3DD F8C3 F2D0 C3B9 8B38 18A2
Theodore Patrick wrote:
Here is the situation:
I have a method called item_method. It contains SQL:SELECT that returns 10 rows of data. When I want to print this to a page in ZOPE. I use an <IN> Statement as follows. Currently the data set from the database does not return a row number, so I need Zope to make one up as it prints the HTML. The data set has two columns called this and that. I need the code that generates the <!--#var ?????? --> in the following code.
<!--#in item_method size=10 start=query_start--> ROW_NUM= <!--#var ?????? --> THIS=<!--#var this -->, THAT=<!--#var that --> <!--#in -->
use <!--#var sequence-index--> for example: <!--#in "[0,0,0,0,0,0]"--> Row nr (0-based): <!--#var sequence-index-->, Row nr (1-based): <!--#var "_['sequence-index']+1"--> <br> <!--#/in --> -------------------- Hannu
participants (3)
-
Hannu Krosing -
Theodore Patrick -
Tony McDonald