A
A.M
Hi
I use a code similar to this to retrieve data from Oracle database:
import cx_Oracle
con = cx_Oracle.connect("me/secret@tns")
cur = con.cursor()
outcur = con.cursor()
cur.execute("""
BEGIN
MyPkg.MyProccur);
END;""", cur=outcur)
for row in out_cur:
print row
The problem is I don't know how to find out what are the column name and
type that comes out of query (each row in cursor).
Is there any possibility that my Python code can find out the column name
and type in each row in cursor?
The other problem is accessing data in each row by column name. In Ruby I
can say:
Print row["ColName"]
In Python; however, I must access to row contents by integer index, like
PRINT ROW[0], which reduces my program's readability.
Can I access to row's contents by column name?
Any help would be appreciated,
Alan
I use a code similar to this to retrieve data from Oracle database:
import cx_Oracle
con = cx_Oracle.connect("me/secret@tns")
cur = con.cursor()
outcur = con.cursor()
cur.execute("""
BEGIN
MyPkg.MyProccur);
END;""", cur=outcur)
for row in out_cur:
print row
The problem is I don't know how to find out what are the column name and
type that comes out of query (each row in cursor).
Is there any possibility that my Python code can find out the column name
and type in each row in cursor?
The other problem is accessing data in each row by column name. In Ruby I
can say:
Print row["ColName"]
In Python; however, I must access to row contents by integer index, like
PRINT ROW[0], which reduces my program's readability.
Can I access to row's contents by column name?
Any help would be appreciated,
Alan