I am trying to read a LOB object returned by a spatial function in an Oracle 12c database. In general this works fine, but I've noticed that if the size of the LOB exceeds ~9963 bytes the cursor will omit everything up to the first left parenthesis. So essentially what I'm expecting is:
LINESTRING ( 2720095.00001681 281993.71874480, 2720084.25003831 281969.81262463, [...])
and what I'm getting back is:
( 2720095.00001681 281993.71874480, 2720084.25003831 281969.81262463, [...])
No matter how big the LOB, it always starts right there at the
(. I don't see anything else wrong with the output. It doesn't appear to be truncated at the end.
I tried the same query in a database client (SQL Developer) and couldn't reproduce the issue.
For reference this is my SQL:
SELECT SDE.ST_AsText(SHAPE) FROM STREET_CENTERLINES WHERE SEG_ID = 960897
import cx_Oracle db = cx_Oracle.connect('...') c = db.cursor() shape = c.execute('SELECT SDE.ST_AsText(shape) FROM street_centerline where seg_id = 960897').fetchone() print(shape.read())
Any insights would be much appreciated!