[Zope] Get Column Names from SQL Query?
Laurie Nason
laurien@tiger.bcm.tmc.edu
Wed, 4 Apr 2001 13:52:46 -0500
Sorry about that - I have all my queries in a directory called queries and
the name of the query is qryreturnallusers.
The bit you need is the .names() on the end of whatever query you are
calling.
HTH
L %:-}
-----Original Message-----
From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
Thomas B. Passin
Sent: Wednesday, April 04, 2001 1:33 PM
To: Zope Mailing List
Subject: Re: [Zope] Get Column Names from SQL Query?
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
_______________________________________________
Zope maillist - Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope-dev )