Re: How Can I insert Unicode Characters thru SQL*Plus

From: foster.feng@ni.com
Date: Fri Jun 07 2002 - 15:51:09 EDT


When Oracle SQL*Plus inserts text into tables, it does not simply insert it
as it is. It compares 2 parameters: the server side NLS_CHARACTERSET and
the client side NLS_LANG, if they don't match, Oracle tries to translate it
before insertion (or retrieval). The server side NLS_CHARACTERSET has to be
a superset of the client side NLS_LANG or the translation will fail.

The server side NLS_CHARACTERSET is in table NLS_DATABASE_PARAMETERS, which
is created during database creation. The client side NLS_LANG parameter
(either as environmental variable in unix, or in registry for Windows) can
be set at session level. For example, our database is UTF-8 and our clients
can have NLS_LANG set as JA16EUC, JA16SJIS or WE8ISO8859P1. SQL*Plus
properly translates between JA16EUC/JA16SJIS/WE8ISO8859P1 and UTF8.

So please make sure that
1. Your database is UTF-8. (select value from nls_database_parameters where
parameter = 'NLS_CHARACTERSET';) If not, you can not insert unicode into
the database.
2. Set your client NLS_LANG to match the text that you want to insert.
Note: It does not have to be UTF-8, SQL*Plus will translate it for you.

Hope this helps.

Foster

                                                                                                                              
                      "Sreedhar.M"
                      <sreedhar@cmcltd To: <unicode@unicode.org>
                      .com> cc: <Malini.Amruthavakkula@corporate.ge.com>
                      Sent by: Subject: How Can I insert Unicode Characters thru SQL*Plus
                      unicode-bounce@u
                      nicode.org
                                                                                                                              
                                                                                                                              
                      06/07/2002 09:19
                      AM
                                                                                                                              
                                                                                                                              

Hi,
I'm working on Internationalization.
My System Configuration:

Operating System : Windows2000 Professional
Database:ššš Oracle 9i
Font : Arial Unicode MS ( suitable font for my language for display)

I tried so much to directly insert Unicode Characters(Telugu [INDIA]
Language Characters copied from UNIEDIT Software to the SQL* Plus editor)
into Oracle 9i database through SQL*Plus editor. But all the time I was
not succeeded.Please tell me what is the processš to insert directly these
Unicode characters(Additional Configuraions to do?????)
I just created a tablespace with the following commands through my
SQL*Plus.

1.create tablespace MyTablespace datafile 'e:\Datafiles\MyDatafile.dbf'
size 10m autoextend on maxsize unlimited;

2.create user foo identified by foo default tablespace MyTablespace;

3.grant resource,connect to foo;

Then I created a table with the follwing command

1) create table MyTable(str nchar(200));
2) insert intošMyTable values('???');šššššš // This is my own language
word

But the result isšš "ORA-12704: character set mismatch"

ššš ššš ššš ššš ššš ššš ššš Please tell me how to proceed for insertion
in detail.

ššš ššš ššš ššš ššš ššš šššššš "This is veryšUrgent for my project"

ššš ššš ššš Thanks in Advance and Thanks a Lot for reading this huge mail
with so much patience.
šRgds,
Sreedhar.M



This archive was generated by hypermail 2.1.2 : Fri Jun 07 2002 - 14:53:20 EDT