[egenix-users] column names ?

stuff at mailzilla.net stuff at mailzilla.net
Mon Aug 4 14:59:59 CEST 2003


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).  

c.colcount seems to return the correct number of columns, so that could be
useful.  Is there a way to map the column name to a column number.  That
is, if I have a colcount of 10, how can I determine the name of column 4?

I suspect the answer is "no" considering that the pretty_print mx.ODBC 
method seems to be unaware of the column names (at least according to the 
mxODBC examples on the web site).

Thanks for any info,

Phil




More information about the egenix-users mailing list