I have this code to take the text from a blob column of my database:
import cx_Oracle
ip = 'your host'
port = 1521
SID = 'ORCL'
USER = 'user'
PASSWORD = 'password'
dsn_tns = cx_Oracle.makedsn(ip, port, SID)
dsn = cx_Oracle.makedsn(ip, port, SID)
orcl = cx_Oracle.connect(USER + '/' + PASSWORD + '@' + dsn)
curs = orcl.cursor()
sql = """SELECT blob_column from table"""
curs.execute(sql)
rows = curs.fetchall()
for x in rows:
list_ = list(x)
print(x[0].read)
But when i print with the for, i got this result:
<built-in method read of cx_Oracle.LOB object at 0x0547EAE8>
<built-in method read of cx_Oracle.LOB object at 0x0547EAD0>
<built-in method read of cx_Oracle.LOB object at 0x0711D770>
How can i return the text from my blob column?