The call to cursor.setinputsizes() is not needed for cx_Oracle 6 and higher.

This commit is contained in:
Anthony Tuininga 2019-02-04 15:29:50 -07:00
parent c11c24fb0d
commit 2f9c01a877
1 changed files with 4 additions and 2 deletions

View File

@ -41,10 +41,12 @@ longString = ""
for i in range(10):
char = chr(ord('A') + i)
longString += char * 25000
cursor.setinputsizes(None, cx_Oracle.LONG_STRING)
# uncomment the line below for cx_Oracle 5.3 and earlier
# cursor.setinputsizes(None, cx_Oracle.LONG_STRING)
cursor.execute("insert into TestClobs values (:1, :2)",
(i + 1, "STRING " + longString))
cursor.setinputsizes(None, cx_Oracle.LONG_BINARY)
# uncomment the line below for cx_Oracle 5.3 and earlier
# cursor.setinputsizes(None, cx_Oracle.LONG_BINARY)
cursor.execute("insert into TestBlobs values (:1, :2)",
(i + 1, longString.encode("ascii")))
connection.commit()