Re: [cx-oracle-users] ORA -24806 error reading NCLOB data
Brought to you by:
atuining
From: Chris D. <cdu...@ya...> - 2006-08-07 07:04:39
|
Anthony, The next release will be fine for me at present. If for some reason I do need the patch sooner I'll let you know. Thanks again for all your hard work, much appreciated. Chris --- Anthony Tuininga <ant...@gm...> wrote: > Got it. That replicated it quite nicely and I was able to provide a > patch for it. That will be included in the next release. If you need > (want) it sooner I can provide the patch for you. Thanks for providing > the test case. > > On 8/4/06, Chris Dunscombe <cdu...@ya...> wrote: > > Hi, > > > > Here's a simple test case that produces the ORA-12704 Character set mismatch error > > > > 1. The setup SQL > > > > create table nclob_source (col1 nclob); > > create table nclob_dest (col1 nclob); > > insert into nclob_source values ('dsfdfsdsf'); > > commit; > > > > 2. Python code > > > > def insertCursorNclob(): > > c1 = db.cursor() > > c2 = db.cursor() > > c3 = db.cursor() > > sourceVars = c1.execute("select col1 from nclob_source") > > targetVars = c2.setinputsizes(*sourceVars) > > c3.execute("select col1 from nclob_source") > > for row in c3.__iter__(): > > print row > > print row[0].read() > > c2.execute("insert into nclob_dest (col1) values(:arg3)", (row[0].read(),)) > > print "Success !!!" + "\n" > > > > import cx_Oracle as cx > > db = cx.connect("u1/p1@db1") > > > > print "NCLOB insert !" > > insertCursorNclob() > > db.commit() > > > > 3. Output > > > > NCLOB insert ! > > (<cx_Oracle.LOB object at 0x40295560>,) > > dsfdfsdsf > > Traceback (most recent call last): > > File "nclob_cx_420.py", line 21, in ? > > insertCursorNclob() > > File "nclob_cx_420.py", line 11, in insertCursorNclob > > c2.execute("insert into nclob_dest (col1) values(:arg3)", (row[0].read(),)) > > cx_Oracle.DatabaseError: ORA-12704: character set mismatch > > > > > > BTW standard SQL as follows works fine: > > > > insert into nclob_dest select * from nclob_source; > > > > Hope this helps. > > > > Chris > > > > > > > > --- Anthony Tuininga <ant...@gm...> wrote: > > > > > On 7/24/06, Chris Dunscombe <cdu...@ya...> wrote: > > > > Hi, > > > > > > > > I've given it a try and my simple test case now works, thanks. However in my actual > > > application I > > > > now get an ORA-12704 Character set mismatch error. I need to investigate this one further > to > > > see > > > > exactly what's going on. > > > > > > Yes please! I didn't get such difficulties but I set up a rather > > > contrived situation since I don't personally use this feature much at > > > all -- and then only with single byte character sets such as latin-1. > > > > > > > Also with 4.2 I now get lots of Primary key violations on inserts after doing > > > cursor.fetchraw() > > > > and then inseting the results. The code works fine and as expected with 4.1.2. I'll need > to > > > some > > > > more digging at my end on this as well but it does seem strange to get such different > > > behaviour > > > > changing from 4.1.2 to 4.2. > > > > > > Hmm, that is strange. If you can provide a test case that would be great. > > > > > > > Thanks again, > > > > > > > > Chris > > > > > > > > --- Anthony Tuininga <ant...@gm...> wrote: > > > > > > > > > Ok, I've had a chance to look at this and the reason the problem is > > > > > occurring is because Oracle wants SQLCS_NCHAR set as the character set > > > > > form and does not do so automatically. I've modified cx_Oracle to do > > > > > this as needed. There may be additional work that is needed (and I've > > > > > added infrastructure to support it) but my initial attempts to bind > > > > > NCLOB data appear to work just fine. After this is released (hopefully > > > > > very soon) you can check it out and let me know if more work is > > > > > needed. > > > > > > > > > > On 6/9/06, Anthony Tuininga <ant...@gm...> wrote: > > > > > > Unfortunately, none at the moment. But I'll take a look at it at some > > > > > > point soon and let you know if I find anything. If anyone else has any > > > > > > information I'd love to hear about it. My knowledge of Unicode is not > > > > > > all that extensive. :-) > > > > > > > > > > > > On 6/9/06, Chris Dunscombe <cdu...@ya...> wrote: > > > > > > > I'm trying to read data from an NCLOB column using: > > > > > > > > > > > > > > for nclob_col, other_col in cursor.__iter__(): > > > > > > > nclob = nclob_col.read() > > > > > > > ...... > > > > > > > > > > > > > > This returns the Oracle error ORA-24806 - Lob form mismatch. > > > > > > > > > > > > > > Environment is: > > > > > > > cx_Oracle version 4.1.2 > > > > > > > Oracle version 9.2.0.7 > > > > > > > Python 2.3.3 > > > > > > > SuSE Linux 8.2 > > > > > > > > > > > > > > Anyone any ideas? > > > > > > > > > > > > > > Thanks, > > > > > > > > > > > > > > Chris Dunscombe > > > > > > ------------------------------------------------------------------------- > > > 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 > > > > > > > > > __________________________________________________ > > 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 > > > > ------------------------------------------------------------------------- > 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 > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |