[Zope] Get Column Names from SQL Query?

Casey Duncan cduncan@kaivo.com
Wed, 04 Apr 2001 14:34:19 -0600


"Thomas B. Passin" wrote:
> 
> Thanks, but neither of these work.  What am I missing?
> 
> [Casey Duncan]
> > I think you should be able to do something like this (untested):
> >
> > <dtml-with name="sqlMethod">
> >     <dtml-in name="dictionaries">
> >         <dtml-in name="sequence-item" mapping>
> >             <dtml-var name="sequence-key">:
> >             <dtml-var name="sequence-item"><br />
> >         </dtml-in>
> >     </dtml-in>
> > </dtml-in>
> >
> 
> My sql method has no attribute named "dictionaries", so this fails.  What do
> you have, that you are calling "sqlMethod", that does have a dictionaries
> attribute?
> 

"dictionarys" is a method of the ZSQL result object. Perhaps this might
work better:

<dtml-in expr="sqlMethod(REQUEST).dictionaries()">
    <dtml-in name="sequence-item" mapping>
        <dtml-var name="sequence-key">:
        <dtml-var name="sequence-item"><br />
    </dtml-in>
</dtml-in>

-- 
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>