How to get column labels?

Asked by jung sung hun

hello.

thank you for rescuing me from native driver hell.

i'm wondering how to get column labels?

if a query is like below,

   select cust_id as "Customer Id",
            cust_name "Customer Name"
   from customer

i want to get "Customer Id" and "Customer Name".

Question information

Language:
English Edit question
Status:
Answered
For:
JayDeBeApi Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Bastian (baztian) said :
#1

Please refer to http://legacy.python.org/dev/peps/pep-0249/#description
In your case
cust_id_name, cust_name_name = curs.description[0][0], curs.description[1][0]
should do the trick

Can you help with this problem?

Provide an answer of your own, or ask jung sung hun for more information if necessary.

To post a message you must log in.