这就是我在 Python 中处理来自数据库的记录的方式
代码.py
conn = cx_Oracle.connect('pass the connection string')
cursor = conn.cursor()
sql = "select * from emp table"
cursor.execute(sql)
result =cursor.fetchall()
for row in result:
name = row[0]
age = row[1]
问题:有没有办法直接获取列名,而不是硬编码为 row[0],row[1]?