On Apr 11, 2012, at 6:56 AM, Pierre Bossé wrote: > Hi everyone, > > We have a problem with the UnicodeText type that stores data in an > Oracle NCLOB column. > When we use a unicode string in python to write data in the table, we > are limited to 4000 characters while it is possible to store a lot > more characteres (6000 in the following example) using a str type. > > Is there something we are doing wrong?
to get the real details on this you need to email the cx_oracle list at https://lists.sourceforge.net/lists/listinfo/cx-oracle-users . (that ValueError is raised by cx_oracle, not SQLAlchemy). the brief, handwavy answer I can give is that the OCI protocol for passing non-ascii information is different than that which it uses for ascii. For example if it uses something like UTF-16 on the wire for Python unicode objects, a limit of 4000 characters comes out to 8000 bytes. If you send ASCII, you can store twice as many characters in the same amount of bytes. So cx_oracle and/or OCI is probably not treating your non-unicode string as "characters", it's assuming it can be up to 8000 bytes long. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
