Home » SQL & PL/SQL » SQL & PL/SQL » Export CSV to Chinese characters (10.2.0.3.0)
Export CSV to Chinese characters [message #410635] Mon, 29 June 2009 07:04
user71408
Messages: 585
Registered: November 2007
Location: NE
Senior Member

Hi,

We have a requirement to export data from Oracle database tables to a CSV file in the Unix server. We have created a unix shell script to run this as a batch job. We are using the below logic to achieve this.

SPOOL ACCOUNT_DATA.csv

PROMPT OUTPUT_VALUES

SELECT VAL FROM S_SAL_VAL WHERE TYPE LIKE 'MON%' AND LANG_ID = 'CHINESE' AND ROWNUM <= 5;

SPOOL OFF

Unfortunately, the Chinese characters in the data are being displayed as "?" symbols and not as Chinese characters in the CSV file. If we connect to SQLPLUS from the Unix server and check the output of SQL, we still get "?" symbols. But if we view the values from our Siebel application, we are able to see the Chinese characters properly.

The NLS_LANG parameters in DB are given below.
NLS_LANGUAGE = AMERICAN
NLS_TERRITORY = AMERICA
NLS_CHARACTERSET = AL32UTF8

Since this is in Unix environment, we checked the NLS Settings of the database and tried to change it to NLS_LANG = Chinese but that still didn't help resolve the issue.
can you please shed some light on how we can export Chinese character data into CSV files?

Thank you,
SNN
Previous Topic: value expand to extra 2 digit (merged 3)
Next Topic: Upper Function
Goto Forum:
  


Current Time: Thu Dec 08 08:50:32 CST 2016

Total time taken to generate the page: 0.18463 seconds