Thomas Apostolou wrote:
Hello all,
i use the following to get to show the results from an
sql query.
What are the expresions to show the field names?

<table>
  <dtml-in expr="TestODBCEM(sysDSN=sysDSN, usr=usr,
mypass=mypass, sSQL=sSQL)">
    <dtml-if sequence-even>
      <tr bgcolor="lightgreen">
    <dtml-else>
      <tr>
    </dtml-if>
    <dtml-in sequence-item>
      <td><dtml-var sequence-item></td>
    </dtml-in>
</tr> </dtml-in>
</table>

You can ask the Results object 'names()' to get the names of the columns of your results. Note you need to ask the results list, not an individual result, so you'll need to define "TestODBCEM(sysDSN=sysDSN, usr=usr, mypass=mypass, sSQL=sSQL)" as something so as to ask it for names and loop over it later.

                --jcc

--
"Building Websites with Plone"
http://plonebook.packtpub.com/

Enfold Systems, LLC
http://www.enfoldsystems.com
_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to