[Zope-DB] Re: ZSQL Result Set: How to find out column's names?

Igor Elbert ielbert@genuone.com
Mon, 3 Feb 2003 22:02:16 -0500


Stephan Herschel wrote:
> Hi group,
>
> I'm testing a ZSQL Method which uses a dynamically constructed
> sql-statement. Thus i don't know the column names of the result set.
>
> How can I get the column names to display them in a dtml-method?
>
> The only thing I found was a reference to the 'Searchable Object
> Interface' in the Zope-book and a hint to a method called
> _searchable_result_columns() which cannot be called as it starts with a
'_'

names and dictionaries methods of Results will give you what you need.

Check out http://www.zope.org/Members/spinwing/ZSQL_Results for examples and
explanations.
If you decide to use it with ZPT may I (shamelessly) suggest
http://www.zope.org/Members/ielbert/zsql2zpt

Igor