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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Cannot Store Chinese Characters In Oracle 9.2 Database

Re: Cannot Store Chinese Characters In Oracle 9.2 Database

From: <kennymcetech_at_googlemail.com>
Date: 12 Jan 2007 02:54:15 -0800
Message-ID: <1168599255.047335.300210@v45g2000cwv.googlegroups.com>


I've only tried importing some test data using an Oracle External Table (which didn't seem to work very well). Once I'm satisfied that the database is correctly storing the chinese character data, it will only be input via the web application (via ADO).

Alain Migeon wrote:
> In article <1168597044.393370.247670_at_i15g2000cwa.googlegroups.com>,
> kennymcetech_at_googlemail.com says...
> > Hi,
> >
> > I'm having trouble localizing my Oracle 9.2 / ASP web application for
> > our Chinese-speaking users.
> >
> > My Oracle 9.2 Database has NLS_NCHAR_CHARACTERSET set to AL16UTF16.
> >
> > I've set up a test table thus:
> >
> > CREATE TABLE "TBL_TEST_CH"
> > (
> > field1 NVARCHAR2(40),
> > field2 NVARCHAR2(40)
> > )
> > /
> >
> > I have the chinese character set installed on my database / web server
> > (same box), as well as a test client machine. I can see chinese
> > characters in my web browser, and can enter them in a test ASP page
> > I've set up. When I execute an insert statement via ADO, the insert
> > statement seems to work, but the result is that the data seems to be
> > stored as upside-down question marks.
> >
> > I thought perhaps the data was being somehow scrambled between the web
> > app and the database, so I set up an external table import the chinese
> > data from a unicode text file:
> >
> > CREATE TABLE kenny.ch_import
> > (
> > FIELD1 NVARCHAR2(255),
> > FIELD2 NVARCHAR2(255)
> > )
> > ORGANIZATION EXTERNAL (TYPE oracle_loader
> > DEFAULT DIRECTORY ext_dat_dir
> > ACCESS PARAMETERS
> > (RECORDS DELIMITED BY ":"
> > FIELDS TERMINATED BY "~"
> > missing field values are null)
> > LOCATION (ext_dat_dir:'test_ch.txt'))
> > reject limit unlimited
> > /
> >
> > However, when I query the data in the external table using my web
> > application, it comes back with garbage like "ÿþ1" and the like.
> >
> > I'd really appreciate any suggestions on what I could do next to
> > determine exactly where the problem lies. I've not been able to
> > convince myself that the database is correctly storing the chinese
> > character data, but I appreciate equally that the problem could lie
> > elsewhere.
> >
> > Thanks in advance,
> >
> > Kenny McEwan.

>

> I have initiated a thread toward a problem when storing Unicode
> characters in a database. That time, it was with cyrillic characters.
>

> Question : how do you import your data? Is it with ODBC, JDBC, or
> directly OCI?
>

> If you use ODBC in C/C++ programming, then you can follow these steps,
> in order to build queries to import data with Unicode characters :
>

> - first create a query where all strings containing Unicode characters
> are replaced by the interrogation point (?),
> - call SQLPrepare with the query,
> - call SQLBindParamater for each string,
> - call SQLExecute.
>

> There are sample code in the help of the Oracle ODBC driver.
>
>

> _________________________________________________
> Alain Migeon
> Please reverse alain and migeon for replying.
Received on Fri Jan 12 2007 - 04:54:15 CST

Original text of this message

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