[Zope] Get Column Names from SQL Query?

Thomas B. Passin tpassin@mitretek.org
Wed, 4 Apr 2001 14:33:01 -0400


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?


[Laurie Nason]
<dtml-let Fields="queries.qryreturnallusers().names()">
  <dtml-in Fields>
<dtml-var sequence-item></p>
</dtml-in>
</dtml-let>

I assume that your sqlMethod is called "queries".  My sql method has no
attribute (i.e., method) called qryreturnallusers, so this way fails too.
How did you get a method with that name associated with your sql method?

Thanks,

Tom P