I was using sqlalchemy Session and executing the command directly in Session instead of a cursor.
When I created a cursor and did cursor.execute(procedure)
, I got access to LOB content with read() method as desired.
Вопрос
I'm trying to access the value of a LOB returned by a procedure with cx_Oracle
. LOB is the first field of tuple ('reg[0]'
).
When I do this:
regs = cursor.fetchall()
for reg in regs:
print reg[0]
The following error happens:
DatabaseError: ORA-22922: nonexistent LOB value
And when I try to use read() method (reg[0].read()
instead of print reg[0]
), but the error is the same.
How can I access the LOB value in this case?
Решение
I was using sqlalchemy Session and executing the command directly in Session instead of a cursor.
When I created a cursor and did cursor.execute(procedure)
, I got access to LOB content with read() method as desired.