I have this code:
dsn = cx_Oracle.makedsn(hostname, port, sid) orcl = cx_Oracle.connect(username + '/' + password + '@' + dsn) curs = orcl.cursor() sql = "select TEMPLATE from my_table where id ='6'" curs.execute(sql) rows = curs.fetchall() print rows template = rows[0][0] orcl.close() print template.read()
When I do print rows
, I get this:
[(<cx_Oracle.LOB object at 0x0000000001D49990>,)]
However, when I do print template.read()
, I get this error:
cx_Oracle.DatabaseError: Invalid handle!
Do how do I get and read this data? Thanks.