1

We are on Oracle9i Enterprise Edition. I tried the following in PL/SQL. MANUFACTUERER Field is defined as VARCHAR2(75). I tried similar table with NVARCHAR2(75) instead, and same result.

INSERT INTO TLP.part_extensions_tab(MANUFACTURER, MANUFACTURER_ADDRESS_LINE ) 
SELECT 'Neal Chinese Test 06', '统一通信系统)【功能性备注:集团电话' FROM DUAL;
commit;
select MANUFACTURER, MANUFACTURER_ADDRESS_LINE from TLP.part_extensions_tab 
where MANUFACTURER like 'Neal Chinese Test 06' ;

The SQL runs, but returns the following question marks; so I'm not sure the insert worked, or if I have a problem displaying the text back in Chinese.

enter image description here

My other Googling lead me down this path (not sure if it is a dead end or not):

DECLARE 
   MyLanguage nvarchar2(30);

BEGIN 
  --EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_LANGUAGE = ''SPANISH''';
  EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_LANGUAGE = ''SIMPLIFIED CHINESE_CHINA.ZHS16GBK''';

  select Value into MyLanguage from nls_database_parameters where Parameter = 'NLS_LANGUAGE'; 
  DBMS_OUTPUT.put_line('MyLanguage=' || MyLanguage);  
  --DBMS_OUTPUT.put_line('NLS_LANG=' || NLS_LANG);  
END;

--SELECT USERENV ('language') FROM DUAL;

But this gives me "ORA-12705; invalid or unknown NLS parameter value specified. I don't know if that language needs to be installed on my client, my server, or my syntax is just wrong. When I tried Spanish, the SQL ran without error, and it shows Spanish.American in the result. emphasized text

2
  • What is the characterset of your database? select * from nls_database_parameters where parameter like '%CHARACTERSET'; Commented Aug 5, 2016 at 21:20
  • That returns two rows: NLS_NCHAR_CHARACTERSET=AL16UTF16 and NLS_CHARACTERSET = WE8ISO8859P1. I just tested with NVARCHAR2(100) and same result. Commented Aug 5, 2016 at 21:27

2 Answers 2

2

You can not store Chinese characters in a Western European characterset (WE8ISO8859P1).

Define the MANUFACTURER_ADDRESS_LINE column as NVARCHAR2 to use AL16UTF16 and insert the string as below (notice the N modifier):

INSERT INTO tc(MANUFACTURER, MANUFACTURER_ADDRESS_LINE ) 
SELECT 'Neal Chinese Test 06', N'统一通信系统)【功能性备注:集团电话' FROM DUAL;
commit;
0
0

For PL/SQL Developer: change the code editor font to 'Segoe UI Symbol' or 'Segoe MDL2 Assets'. Other preferences (regedit, NLS* params) should not be changed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.