This discussion is archived
5 Replies Latest reply: Apr 9, 2013 2:17 PM by Sergiusz Wolicki (Oracle) RSS

problem with Nvarchar2 insert

troychan Newbie
Currently Being Moderated
I am sorry to post the thread twice,because I think I will find solution here.

I have some problem with using apex browser insert Chinese characters into datebase using nvarchar2 , here is the appearance:
1、my server is winserver2008 Japan ,Datebase is oracle 11g r2 standard one ,APEX version is 4.2 ,web server is embeded plsql ,the server language setting is AMERICAN_AMERICA.JA16SJISTILDE
2、For APEX ,I have installed english Chinese and japanese edition.
3、my client machine is using winxp Chinese edition.
4、server is winserver 2008 Jpanese

when I use PLSQL and TOAD, I found that I kan insert Chinese characters,and query is OK too.
when I use apex bowser , messy characters apears when I query the datebase, for example when I insert '生产‘,when I query the datebase,it only shows '生?', but ,it works well when using plsql and toad.

Can anyone tell me why?

thank you

best regards!

Edited by: 996116 on 2013-4-5 上午12:36
  • 1. Re: problem with Nvarchar2 insert
    Sergiusz Wolicki (Oracle) Expert
    Currently Being Moderated
    Generally, do not use NVARCHAR2. Use VARCHAR2.

    What is the database character set?
    SELECT value FROM nls_database_parameters WHERE parameter='NLS_CHARACTERSET';
    -- Sergiusz
  • 2. Re: problem with Nvarchar2 insert
    troychan Newbie
    Currently Being Moderated
    Hi Sergiusz

    SELECT value FROM nls_database_parameters WHERE parameter='NLS_CHARACTERSET';

    reply: AMERICAN_AMERICA.JA16SJISTILDE

    because the server operating-system and oracle datebase are both installed in Japanese, I can not insert Chinese character as well, so I have to choose nvarchar2, when I create a new table with Nvarchar2, it seemed worked with plsql developer and toad inserting Chinese characters , but not in apex webpage I created.

    So, I think there may be some configurations I can recheck about APEX.

    Can you give me some advises?

    best regards!
  • 3. Re: problem with Nvarchar2 insert
    Sergiusz Wolicki (Oracle) Expert
    Currently Being Moderated
    The result of the query cannot be AMERICAN_AMERICA.JA16SJISTILDE. Please, provide the real result. I need it to confirm the configuration.


    -- Sergiusz
  • 4. Re: problem with Nvarchar2 insert
    troychan Newbie
    Currently Being Moderated
    Hi Sergiusz

    here is the result

    select * from nls_database_parameters t where t.parameter='NLS_CHARACTERSET';
    PARAMETER     VALUE
    NLS_CHARACTERSET     JA16SJISTILDE

    Thank you !
  • 5. Re: problem with Nvarchar2 insert
    Sergiusz Wolicki (Oracle) Expert
    Currently Being Moderated
    I doubt Apex will work well with NVARCHAR2 columns. First, you need to have RAW mode enabled on embedded PL/SQL gateway (transfer-mode DAD attribute set to 'raw'). This may enable NVARCHAR2 support on the OWA level (though I have never tested this). However, Apex may store various GUI content in VARCHAR2 intermediate variables, causing implicit conversion and loss of Chinese characters. You should migrate your database to AL32UTF8 to support both Chinese and Japanese.

    Note that Unicode unifies some of Han/Kanji ideographic characters. To get correct display in Chinese and Japanese, you may need to set the HTML 'lang' tag of your page and/or fonts correctly to force the browser to select either the Chinese or Japanese font, as appropriate for the displayed content.


    -- Sergiusz

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points