On Wed, Jul 20, 2011 at 04:39:14PM +0200, Ionuț Arțăriși wrote:
> Hello,
> 
> We've recently come upon a bug when trying to insert a string of 1024
> unicode characters into a database column of VARCHAR2(1024 BYTE). Rather
> than dealing with string encoding transformations everywhere this
> issue pops up
> in the code, I thought that modifying the database schema would be the
> better solution.
> 
> BYTE seems to be the default for the Oracle database, but unicode
> strings would map better to VARCHAR2(1024 CHAR).
> 
> The problem is that I couldn't find any way to set this in the table
> schema files and get it past chameleon. chameleon just doesn't have the
> right grammar defined to parse VARCHAR2(1024 CHAR) or "alter session set
> nls_length_semantics=char".
> 
> So I was wondering if you guys know more about this problem or a better
> solution than patching chameleon.

Replacing chameleon with a custom script (sed? perl?) which would do
the equivalent transformation but be easier to be extended would be my
preferred option.

I'll be happy to review a patch which would do that.

Adding a char to varchar2 definitions would then be step to, and piece
of cake.

> Is there a specific reason for not
> using VARCHAR2( CHAR)?

Not really, just historical thing.

-- 
Jan Pazdziora
Principal Software Engineer, Satellite Engineering, Red Hat

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to