I'm trying to get a list of column names after calling my postgres stored proc via psycopg2 in python...
Here's my code
# create a connection to the database
conn = psycopg2.connect(...)
# create a cursor object for execution
curs = conn.cursor()
curs.callproc('usp_my_stored_proc', ['mySP'])
# now open a new cursor & "steal" the recordset from the previous cursor
curs2 = conn.cursor('mySP')
# close cursor & connection
curs2.close()
curs.close()
conn.close()
Now I want to print out the columns of my stored proc and make them headers for my CSV file - I've search and I haven't found any leads...
Advice / Help is definitely welcome...