Re: [cx-oracle-users] Issue with fetchraw and executemanyprepared on 4.2.0
Brought to you by:
atuining
|
From: Anthony T. <ant...@gm...> - 2006-08-03 13:44:19
|
Yes. That is expected behavior. I guess I should have been clearer in
the change log. :-(
The new cursor attribute bindarraysize is used to control the number
of rows used to bind. If you use execute() the default of 1 is
perfectly acceptable. If you use executemany() automatic rebinds are
done as needed. That is __not__ done with executemanyprepared() as it
is assumed that everything is ready to go. If you change your one
statement to say "c2.bindarraysize = 5" then everything should work as
before. Hopefully that makes sense to you. :-)
On 8/3/06, Chris Dunscombe <cdu...@ya...> wrote:
> Anthony,
>
> Here's the test case (surfaced as Oracle primary key errors) for issues with fetchraw /
> executmanyprepared in 4.2.0 (Oracle 9.2.0.7 on Linux)
>
> Table setup
>
> create table input (col1 char(3), col2 char(2));
> insert into input values ('xxx', 'xx');
> insert into input values ('yyy', 'yy');
> create table output (col1 char(3), col2 char(2));
>
> Python code
>
> import cx_Oracle as cx
> db1 = cx.connect("u1/p1@db1")
> c1 = db1.cursor()
> c2 = db1.cursor()
> c1.arraysize = 5
> c2.arraysize = 5
> sourceVars = c1.execute("select col1,col2 from input")
> targetVars = c2.setinputsizes(*sourceVars)
> c2.prepare("insert into output (col1,col2) values(:arg1, :arg2)")
> rowsFetched = c1.fetchraw()
> print str(rowsFetched)
> c2.executemanyprepared(rowsFetched)
> db1.commit()
>
> Fails with:
>
> Traceback (most recent call last):
> File "selIns.py", line 13, in ?
> c2.executemanyprepared(rowsFetched)
> cx_Oracle.InterfaceError: iterations exceed bind array size
>
> in 4.2.0 but works fine with 4.1.2
>
> Hope this helps.
>
> Chris
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> cx-oracle-users mailing list
> cx-...@li...
> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users
>
|