Re: [cx-oracle-users] setinputsizes problem?
Brought to you by:
atuining
From: Anthony T. <ant...@gm...> - 2010-07-07 22:34:10
|
On Wed, Jul 7, 2010 at 1:23 PM, Jason Boorn <jb...@gm...> wrote: > Geoff - > > Those are already part of the SQL statement - they were never in the > parameters list. > > I got this working (thanks Anthony) using a dictionary for the parameters You're welcome. > without a call to setinputsizes. I'm guessing this is not optimal, but I > could not get the call to setinputsizes to work as a dictionary, and I > wasn't sure if you could mix named parameters with array-style > setinputsizes. I wouldn't suggest it even if technically you could get away with it. :-) For setinputsizes(), you would need to do the following: keywordArgs = {} keywordArgs["value1"] = cx_Oracle.NUMBER keywordArgs["value2"] = cx_Oracle.CLOB cursor.setinputsizes(**keywordArgs) OR cursor.setinputsizes(value1 = cx_Oracle.NUMBER, value2 = cx_Oracle.CLOB) > I'm guessing that not using the setinputsizes function is not optimal, but I > can get it to work without it so that's what I'm going to do. BTW, I use setinputsizes() as rarely as possible. The only time its worth using is when you plan to execute a statement more than one time in a row and the format of the data changes between executions -- or a value is null (None) in one iteration but has a value in subsequent iterations. In all other situations its probably faster to avoid the setinputsizes() call. Anthony |