Re: varchar2 vs. nvarchar2 and confusing unicode

From: ddf <oratune_at_msn.com>
Date: Tue, 19 Jan 2010 10:22:13 -0800 (PST)
Message-ID: <02a6a31c-7278-49f0-ad9d-7558701d591c_at_m3g2000yqf.googlegroups.com>



On Jan 19, 10:38 am, Christian Kütbach <ckuetb..._at_googlemail.de> wrote:
> Hello NG,
>
> I've got an question: What is the best practice to create a unicode
> supporting column?
>
> I have to set up a Table with unicode support.
>
> Sometime my Table will be installed into an existing Oracle Instance
> (witch may ot be with the startet with the correct NLS settings).
>
> The Documentation is a litlee bit confusing:
>
> If a create a table with following DDL:
>
> create table MyUtf8Test ( vrchr2000Char varchar2(2000 CHAR) );
>
> and insert a (Java String) with 2000 ¤-Signs, i get following error:
> Error: java.sql.SQLException: ORA-01704: Zeichenfolge zu lang, SQL
> State: 42000, Error Code: 1704
>
> Did I cacluate right, that because of the 4000bytes limit, Strings
> longer than 1333 charackters may produce this error?
>
> What is the best practice to create a unicode supporting column?
>
> I have to store 2000 unicode-signs.
> I have an own schema.
>
> I've looked at the oracle website, but it didn't helped.
>
> And where is the difference between varchar2(2000 char) an nvarchar2(2000) ?
>
> Thanks,
>
> Christian Kütbach

VARCHAR2 uses the national character set defined for the database and NVARCHAR2 uses UTF8 or ALUTF32 (depending upon the version of Oracle). The 'N" types are intended for global character support and will work in any Oracle database where those data types are available.

David Fitzjarrell Received on Tue Jan 19 2010 - 12:22:13 CST

Original text of this message