Re: Help ... NVarchar2 Question

From: Jusung Yang <JusungYang_at_yahoo.com>
Date: 16 Oct 2002 16:40:45 -0700
Message-ID: <130ba93a.0210161540.31d8c02b_at_posting.google.com>


It is a bit tricky. Character length semantics is the default and only length semantics for NCHAR or NVARCHAR2. That means NCHAR(5) can hold 5 "characters". CHAR and VARCHAR2 on the other hand, by default, use byte length semantics. That means CHAR(5) can hold 5 "bytes" of data. From the error that you indicated, it would seem the accented "e" takes up more than one byte in UTF8 encoding. So CHAR(5) can no longer hold that string.

  • Jusung Yang

Alexander.Kuznetsov_at_marshmc.com (Alexander Kuznetsov) wrote in message news:<ac5bc7c1.0210161033.1b1e038b_at_posting.google.com>...
> Hi Jusung,
> I just ran a small test against a UTF8 database on Oracle 9.2 server
>
> CREATE TABLE A(C CHAR(5));
>
> then I attempted to issue INSERT INTO A(C) VALUES(:C)
> from an OCI application, the column binded as Unicode, the value
> 'début' (note the accented e)
> got an error saying the value is too wide to fit in the column
> Same test works no problem with NVARCHAR2 columns on different
> servers.
>
> what am I missing?
> thank you
> Alexander
Received on Thu Oct 17 2002 - 01:40:45 CEST

Original text of this message