Print value CLOB via cx_Oracle

V

Vincent Vega

Hi,

I call function in Oracle database use cx_Oracle.
In standard I define:

db = cx_Oracle.connect(username, password, tnsentry)
cursor = db.cursor()

I create variable 'y' (result function 'fun_name') and call function
'fun_name':

y = cursor.var(cx_Oracle.CLOB)
cursor.callfunc(fun_name, cx_Oracle.CLOB, y)

When I print variable 'y' I receive:
<cx_Oracle.CLOB with value <cx_Oracle.LOB object at 0x00999999>>

How can I get value variable 'y'???
How read <cx_Oracle.LOB object at 0x00999999>???


Vincent Vega




Note:
Off course y.read() does not work, cause 'y'is CLOB not LOB.
(see datatypes table in site: http://www.oracle.com/technology/pub/articles/prez-python-queries.html)
 
V

Vincent Vega

Hi,

I call function in Oracle database use cx_Oracle.
In standard I define:

db       = cx_Oracle.connect(username, password, tnsentry)
cursor  = db.cursor()

I create variable 'y' (result function 'fun_name') and call function
'fun_name':

y   = cursor.var(cx_Oracle.CLOB)
cursor.callfunc(fun_name, cx_Oracle.CLOB, y)

When I print variable 'y' I receive:
<cx_Oracle.CLOB with value <cx_Oracle.LOB object at 0x00999999>>

How can I get value variable 'y'???
How read <cx_Oracle.LOB object at 0x00999999>???

Vincent Vega

Note:
Off course y.read() does not work, cause 'y'is CLOB not LOB.
(see datatypes table in site:http://www.oracle.com/technology/pub/articles/prez-python-queries.html)

The solution is simple:

print y.getvalue()

(see: http://cx-oracle.sourceforge.net/html/variable.html)

Thanks! :)

Vincent Vega
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top