Adam Molyneaux writes:
 > still trying to get field names from a query of the form
 > SELECT * FROM MYTABLE
 > 
 > 
 > 
 > ><dtml-in "sqlListTable(table_name='personnel')">
 > >   <dtml-in sequence-item>
 > >      <P><dtml-var sequence_key>
 > ></dtml-in >

If "sqlListTable" is a SQLMethod, you get the sequence of result column
names by:

        "sqlListTable(table_name='personnel').names()"

If, e.g., you want list the first column of your
result set, this could be done as follows:

<dtml-let q="sqlListTable(table_name='personnel')"
          field1= "q.names()[0]">
<dtml-in q>
  <dtml-with sequence-item>
    <dtml-var field1>: <dtml-var "_[field1]"><br>
  </dtml-with>
</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 )

Reply via email to