[Zope] enumerating fields

Thomas B. Passin tpassin@mitretek.org
Mon, 18 Jun 2001 15:28:26 -0400


[Mark McEahern]

> Q:  How do you enumerate and display the field NAMES
> in a SQL result set?
>

As Dieter said, it's been answered here before.  Here is a copy of one of my
posts about this:

===================================================

I remember posting this before, but something seems to have eaten it.
Laurie Nason nailed it for me, many thanks Laurie.

Here is a summary of the result:

Given a ZSQL query named "query1", this DTML will execute the query and
display a list of the column names:

  <dtml-let results=query1>
   <dtml-var "results.names()">
  </dtml-let>

And here it is using dtml-with:

<dtml-with query1>
   <dtml-var "names()">
</dtml-with>

Thanks to all for the help.

Regards,

Tom P