You're converting a CLOB to a string of some description. There's a maximum of 4,000 characters in a string in SQL so you need to take a sub-string of the CLOB if you want to place it into a character.
The simplest way to do this is to use DBMS_LOB.SUBSTR
.
It doesn't appear as though simple.data.oracle
supports CLOBs natively; if you look at the code for the DBTypeConverter
class the dictionary maps a CLOB to DBType.String
:
{"CLOB", DbType.String},
This is despite the documentation linked in the comments indicating that it should be mapped to DBType.Object
. Though the mappings have changed very slightly in the 11.2 documentation a CLOB is still an object.
I don't know the reasons for deciding that a CLOB is a string but as I see it you have a few options:
- Raise a bug report on GitHub and be prepared to be told it's not a bug.
- Pull a version and change it yourself - be warned that as a CLOB is assumed to be a string there may be a lot of changes to make.
- Use
DBMS_LOB.SUBSTR
and "chunk" the CLOB into as many strings as are required using the offset parameter.