I would like to be able to use my SQL table in python. I managed to connect and access my table using the code.
I would like to know if it was possible to retrieve the column names in my code.
I already have my colomns:
ACTION | MANAGER
123 XYZ
456 ABC
PersonnesQuery = "SELECT........"
cursor = mydb.cursor()
cursor.execute(PersonnesQuery)
records_Personnes = cursor.fetchall()
for row in records_Personnes:
if (row["MANAGER"] == "XYZ"):
..................
elif (row["MANAGER"] == "ABC"):
................
the way quoted does not seem to work. However, it works with the number, for example row[0]. But I would like by column name