Skip to content

Commit 2f9c01a

Browse files
The call to cursor.setinputsizes() is not needed for cx_Oracle 6 and higher.
1 parent c11c24f commit 2f9c01a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

samples/ReturnLobsAsStrings.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@ def OutputTypeHandler(cursor, name, defaultType, size, precision, scale):
4141
for i in range(10):
4242
char = chr(ord('A') + i)
4343
longString += char * 25000
44-
cursor.setinputsizes(None, cx_Oracle.LONG_STRING)
44+
# uncomment the line below for cx_Oracle 5.3 and earlier
45+
# cursor.setinputsizes(None, cx_Oracle.LONG_STRING)
4546
cursor.execute("insert into TestClobs values (:1, :2)",
4647
(i + 1, "STRING " + longString))
47-
cursor.setinputsizes(None, cx_Oracle.LONG_BINARY)
48+
# uncomment the line below for cx_Oracle 5.3 and earlier
49+
# cursor.setinputsizes(None, cx_Oracle.LONG_BINARY)
4850
cursor.execute("insert into TestBlobs values (:1, :2)",
4951
(i + 1, longString.encode("ascii")))
5052
connection.commit()

0 commit comments

Comments
 (0)