I have a need for this type also. One table lists items with several varchar fields and about 40 Boolean fields (various options each item has or doesn't have). Another table (options) has 2 columns - option and optionDescription. The option is the column name of each of the Boolean fields and the optionDescription is a text description of each option. I need a query that will get all the details of an item and if any of the 40 options is set with a TRUE, then display the optionDescription from the 'options' table - not just a 1 or 0. So, I will need to compare the option name with the column name from the item table. SLIGHTLY off-topic but someone else started it! <8^) Thanks Allen -----Original Message----- From: Laurie Nason [mailto:laurien@tiger.bcm.tmc.edu] Sent: Wednesday, April 04, 2001 12:04 PM To: Thomas B. Passin; Zope Mailing List Subject: RE: [Zope] Get Column Names from SQL Query? I have found something that does this but haven't managed to make it work as I want it to yet! <dtml-let Fields="queries.qryreturnallusers().names()"> <dtml-in Fields> <dtml-var sequence-item></p> </dtml-in> </dtml-let> This gives the column headers If anyone knows of a way of doing this which gives the data as well as the headers in one fail swoop then let me know too. Laurie -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Thomas B. Passin Sent: Wednesday, April 04, 2001 10:51 AM To: Zope Mailing List Subject: [Zope] Get Column Names from SQL Query? I want to run an SQL query, like select * from person Then I want to extract the column names from the returned data. In other words, I don't want to hand-code them into the result page. I know how to do this in Cold Fusion, but I don't know how in Zope. I'm using a ZSQL method, of course, to query the database. Anyone know how to do this without running an external method? 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 ) _______________________________________________ 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 )