[Zope] Retrieving Rows, Columns, and ??Column Headings?? from RDB?

Brian Withun brianw@hilgraeve.com
Thu, 13 Sep 2001 13:40:55 -0400


Using an external database such as MySQL, does Zope(2-3-2)
(or Python-in-Zope) provide any mechanism to retrieve the
names of the columns queried, rather than simply the DATA
within those columns?

Please allow me to obfuscate this question with an example
of what I need.. :-)

==================================================UNTESTED
<dtml-in "user_query(fname='Bob')">
  <dtml-let record=sequence-item>

    <dtml-if sequence-start>
      <table>
      <tr>
        <dtml-in "_.range(_.len(record))">
          <th> <dtml-var "record[_['sequence-index']].title"> </td>  <!--
wishful thinking? -->
        </dtml-in>
      </tr>
    </dtml-if>

    <tr>
      <dtml-in "_.range(_.len(record))">
        <td> <dtml-var "record[_['sequence-index']]"> </td>
      </dtml-in>
    </tr>

    <dtml-if sequence-end> </table> </dtml-if>

  </dtml-let>
</dtml-in>
==================================================UNTESTED

Thanks (again) in advance...

------------
Brian Withun
Web Developer
Hilgraeve, Inc.
Monroe, Michigan 48161