Matthew Moisen
Matthew Moisen

Reputation: 18299

cx_Oracle how to set a CLOB member attribute on a PL/SQL Object Type?

I have a PL/SQL object that I want to populate in Python and pass into a PL/SQL procedure.

PL/SQL Object Type:

CREATE TYPE t_foo (
    name VARCHAR2(10),
    data CLOB,
);

Python:

obj_type = conn.gettype('t_foo')
o = obj_type.newobject()

o.NAME = 'test'
# Raises NotSupportedError: Object_ConvertFromPython(): unhandled data type 112
o.DATA = 'big string' 

blobvar = cur.var(cx_Oracle.CLOB)
blobvar.setvalue(0, 'big string')
# Raises NotSupportedError: Object_ConvertFromPython(): unhandled data type 112
o.CONTENTS = blobvar

Is there any way to set a CLOB on an Object Type?

Upvotes: 0

Views: 510

Answers (1)

Anthony Tuininga
Anthony Tuininga

Reputation: 7086

Support for this has been added into the source for cx_Oracle which can be found here: https://github.com/oracle/python-cx_Oracle. A release will follow in the next month or so but in the meantime you can build yourself from a cloned repository.

Upvotes: 1

Related Questions