Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: UTF-8 Unicode.

Re: UTF-8 Unicode.

From: Amit <jindal_at_roguewave.com>
Date: Tue, 22 Apr 2003 15:34:42 -0600
Message-ID: <b84g1b$skq$1@tux.cvo.roguewave.com>


My mistake. I didn't realize that Oracle 8 doesn't has that property.

It should by default be byte. A simple test will be to create a table with a column of VARCHAR2(10) and insert some unicode characters (using some external application). If you can insert 10 unicode characters, its taking char semantics, else byte.
Unfortunately, I currently don't have a database setup for unicode in Oracle 8 so I can't check it.

On Oracle 9 USER_TAB_COLUMNS contains information about the columns and can tell about byte/char for individual columns. Oracle 8 does has this but does not contains columns (CHAR_USED) that indicate this information.

SQL> SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH, CHAR_LENGTH, CHAR_USED   2 FROM USER_TAB_COLUMNS
  3 WHERE TABLE_NAME='AMITTEST'; If you have an option to upgrade, Oracle 9i might be a much better database for internationalization.

HTH,



Amit Jindal, Development Engineer

Want ease of development or performance? Why not get both! http://www.roguewave.com/products/sourcepro/db/

Turbo charge any C/C++ apps - without changing code! http://www.roguewave.com/ATSevan01

[Disclaimer: All views expressed here are my personal views

             and they can be incorrect at times]


"Gaetan Poitras" <poitrasg_at_crcsogema.com> wrote in message news:3ebc2be2.0304220459.41a85bfa_at_posting.google.com...
> Hello Amit, On my 9i database I have the NLS_LENGHT_SEMANTICS set to
> BYTE which is fair, then I know that my VARCHAR2(20) may containt lest
> than 20 Characters.. But I have a problem whit my 8i (8.1.7.0.0)
> database, when I select * from nls_database_parameters I see all
> parameter but there is NO nls_lenght_Semantics so I don't know if the
> semantics is CHAR or BYTE ?
> How can I found if it's char or byte ?
>
> When I create a database with Oracle DAtabase Assistant , is there a
> way to specify the database must be CHAR semantic ? Or I just need to
> change the nls_parameter is regedit ?
>
>
> "Amit" <jindal_at_roguewave.com> wrote in message
news:<b81eqe$plm$1_at_tux.cvo.roguewave.com>...
> > Take a look at this document that describes considerations for
> > Globalization. (You might need a free OTN membership).
> >

http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96529/ch6.htm#
> > 1656
> >
> > I can't speak much about Forms/Reports but I would assume that you will
need
> > to recompile that, unless they were already UTF enabled.
> > Oracle does has the ability for implicit conversion of some datatypes to
UTF
> > and back. Depends on what you are using.
> >
> > More Info:
> > Oracle has 2 datatypes for character storage: VARCHAR2 and NVARCHAR2.
You
> > can define a database which has these with separate characterset.
> > Like VARCHAR2 can be using a AL32UTF8 (UTF8-32bits) (Oracle's
characterset)
> > and NVARCHAR2 can be using AL16UTF16 (UTF16). Or same.
> > You can find out what they are currently by: SELECT * FROM
> > NLS_DATABASE_PARAMETERS. (Might need some permissions).
> >
> > Further you can specify, while creating the database if you want the
> > database in 'BYTE' semantics or 'CHAR' sematics. The difference is, in
Byte
> > semantics, a VARCHAR2(20) column means 20 bytes of storage (and may only
> > hold 10 characters). However in CHAR semantics, a VARCHAR2(20) means 20
> > unicode(whatever character set you specfied) characters and implicitely
the
> > needed size of bytes will be allocated. Default is BYTE semantics.
> > Also for NVARCHAR2 datatypes its always CHAR semantics (no matter what
your
> > database semantics are).
> >
> > Importing a non-utf database to UTF8 should be easy as Oracle can do
> > implicit conversion. However I haven't tried this myself.
> >
> > HTH
> > --
> > Amit
> > Development Engineer
> > http://www.roguewave.com/products/sourcepro/db/
> > [Disclaimer: All views expressed here are my personal views and they can
be
> > incorrect at times]
> >
Received on Tue Apr 22 2003 - 16:34:42 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US