Python Forum
Python Teradata Connector - Column Names - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Python Teradata Connector - Column Names (/thread-12125.html)



Python Teradata Connector - Column Names - gracylayla - Aug-10-2018

Does anyone know how to retrive the column names using Python's Teradata libary..?

Here is a code sample:

import teradata
udaExec = teradata.UdaExec (appName="HelloWorld", version="1.0" logConsole=False)
session = udaExec.connect(method='odbc', system='system_name',authentication='LDAP', username='username', password='REPLACED');
lst_results = []
for row in session.execute("select * from table_name"):
 print(row)
 lst_results.append(row)
The code above will not return the column names. Ultimately, I would like to put the query's results into a Panda's dataframe