From 2f9c01a8775cac06eb28e5bb45ef6b6a36458204 Mon Sep 17 00:00:00 2001 From: Anthony Tuininga Date: Mon, 4 Feb 2019 15:29:50 -0700 Subject: [PATCH] The call to cursor.setinputsizes() is not needed for cx_Oracle 6 and higher. --- samples/ReturnLobsAsStrings.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/samples/ReturnLobsAsStrings.py b/samples/ReturnLobsAsStrings.py index e8ff508..9ee6b1b 100644 --- a/samples/ReturnLobsAsStrings.py +++ b/samples/ReturnLobsAsStrings.py @@ -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()