[egenix-users] column names ?

M.-A. Lemburg mal at lemburg.com
Tue Aug 5 10:29:44 CEST 2003


stuff at mailzilla.net wrote:
> Is there a way, via mxODBC to obtain the column names for a particular 
> query.  For example,
> 
> c = db.cursor()
> 
> sql = "SELECT * FROM foo"
> c.execute(sql)
> 
> 
> I've tried c.columns()  (before and after a fetchone()) but that always 
> yields -1 (at least when connected to SQL Server).  

That's because .columns() generates a result set:

c.columns(table="foo")
print c.fetchall()

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Software directly from the Source  (#1, Aug 05 2003)
 >>> Python/Zope Products & Consulting ...         http://www.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________



More information about the egenix-users mailing list