XMLType.extract cannot display French special characters in the select statement

Hello
E characters (acute e) get distorted when they are retrieved from the
XMLType column of an ordinary table.

How can we solve correctly get the characters e (acute e)?

We tried setting 'setenv NLS_LANG French_France.WE8ISO8859P1' and
"setenv NLS_LANG French_France.WE8DEC" before loading the table.

Database version:
SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
PL/SQL Release 11.2.0.2.0 - Production
CORE    11.2.0.2.0      Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
The test sample case is as follows:
--connect to any schema where you can store XMLType
set long 2000;
set pagesize 2000;
set serveroutput on;
--delete from test;
drop table test;
create table test (id number, xmldata XMLType);


declare
featureDescriptorXML  CLOB;
xml_type XMLType;
new_xml_type XMLType;
myName varchar2(100);
myName2 varchar2(100);
myName3 varchar2(100);
stmt varchar2(4000);
begin
 featureDescriptorXML :=
 '<?xml version="1.0" encoding="UTF-8"?>' ||
 '<abc:TheFeature xmlns:' || 'de' || '="' || 'http://abc.klmno.org/fghde' || '" xmlns:abc="http://www.ghijklmn.net/abc"' ||
 ' xmlns:xyz="http://www.ghijklmn.net/xyz">' ||
 '<abc:Name>de:MyGénérique</abc:Name>' ||
 '</abc:TheFeature>';
 xml_type := xmltype(featureDescriptorXML);
 myName := xml_type.extract('/abc:TheFeature/abc:Name/text()', 'xmlns:abc="http://www.ghijklmn.net/abc"').getStringVal();
 dbms_output.put_line('abc:Name value stored in VARCHAR2 variable from XMLType variable is ' || myName);
 -- can show French chars

 insert into test(id, xmldata) values(20, xml_type);

 stmt := 'select t.xmldata.extract(''/abc:TheFeature/abc:Name/text()'', ''xmlns:abc="http://www.ghijklmn.net/abc"'').getStringVal() from test t';
 execute immediate stmt into myName2;
 dbms_output.put_line('abc:Name value stored in VARCHAR2 variable from XMLType column in 2nd version is ' || myName2);
 -- cannot show French chars


 stmt := 'select  t.xmldata from test t';
 execute immediate stmt into new_xml_type;
 myName3 := new_xml_type.extract('/abc:TheFeature/abc:Name/text()', 'xmlns:abc="http://www.ghijklmn.net/abc"').getStringVal();
 dbms_output.put_line('abc:Name value stored in VARCHAR2 variable from first XMLType column and then from XMLType variable in 3rd version is ' || myName3);
 -- cannot show French chars

end;
/

select t.xmldata.extract('/abc:TheFeature/abc:Name/text()', 'xmlns:abc="http://www.ghijklmn.net/abc"').getStringVal()
from test t;
-- Cannot show French chars


select t.xmldata.extract('/abc:TheFeature/abc:Name/text()', 'xmlns:abc="http://www.ghijklmn.net/abc"').getStringVal() "myname"
from test t;
-- Cannot show French chars


select t.xmldata.getCLOBVal() from test t;
-- Cannot show French chars


select t.xmldata from test t;
-- Can show French chars
Output is the following with setenv NLS_LANG French_France.WE8ISO8859P1
and NLS_DATABASE_PARAMETERS are the following:
SQL> select * from nls_database_parameters;

PARAMETER                      VALUE
------------------------------ ----------------------------------------
NLS_LANGUAGE                   AMERICAN
NLS_TERRITORY                  AMERICA
NLS_CURRENCY                   $
NLS_ISO_CURRENCY               AMERICA
NLS_NUMERIC_CHARACTERS         .,
NLS_CHARACTERSET               WE8DEC
NLS_CALENDAR                   GREGORIAN
NLS_DATE_FORMAT                DD-MON-RR
NLS_DATE_LANGUAGE              AMERICAN
NLS_SORT                       BINARY
NLS_TIME_FORMAT                HH.MI.SSXFF AM

PARAMETER                      VALUE
------------------------------ ----------------------------------------
NLS_TIMESTAMP_FORMAT           DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT             HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT        DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY              $
NLS_COMP                       BINARY
NLS_LENGTH_SEMANTICS           BYTE
NLS_NCHAR_CONV_EXCP            FALSE
NLS_NCHAR_CHARACTERSET         AL16UTF16
NLS_RDBMS_VERSION              11.2.0.2.0

20 ligne(s) sélectionnée(s).
Table creé.

abc:Name value stored in VARCHAR2 variable from XMLType variable is
de:MyGénérique
abc:Name value stored in VARCHAR2 variable from XMLType column in 2nd version is
de:MyGénérique
abc:Name value stored in VARCHAR2 variable from first XMLType column and then
from XMLType variable in 3rd version is de:MyGénérique

Procdure PL/SQL terminée avec succès.


T.XMLDATA.EXTRACT('/ABC:THEFEATURE/ABC:NAME/TEXT()','XMLNS:ABC="HTTP://WWW.GHIJK
--------------------------------------------------------------------------------
de:MyGénérique


myname
--------------------------------------------------------------------------------
de:MyGénérique


T.XMLDATA.GETCLOBVAL()
--------------------------------------------------------------------------------
<?xml version="1.0" encoding="DEC-MCS"?>
<abc:TheFeature xmlns:de="http://abc.klmno.org/fghde" xmlns:abc="http://www.ghij
klmn.net/abc" xmlns:xyz="http://www.ghijklmn.net/xyz">
  <abc:Name>de:MyGénérique</abc:Name>
</abc:TheFeature>



XMLDATA
--------------------------------------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<abc:TheFeature xmlns:de="http://abc.klmno.org/fghde" xmlns:abc="http://www.ghij
klmn.net/abc" xmlns:xyz="http://www.ghijklmn.net/xyz">
  <abc:Name>de:MyGénérique</abc:Name>
</abc:TheFeature>
We also tried affecting NLS_CHARACTERSET AL32UTF8
by CHARACTER SET of ALTER DATABASE.
the database is closed and restarted.
But that did not help.

Thank you

Ok. Wasn't sure. Thank you for that clarification.

.. .but please make an attempt with XMLTABLE XMLQUERY, XMLCAST (or CAST) and other XML functions that support XQuery and not to use the engine of 'old '... I hope that these features will keep things as it should...

.. .If not... create an SR with support of Oracle on this issue. Changes, if you base your SR on these 'old' operators XML/SQL and functions that are her will not be able to help, mainly due to the fact that your last version and stuff like EXTRACT / getStringVal() etc. are announced officially discouraged in this 11.2.0.2.0 version. As far as I know the t.xmldata.extract, the xml_type.extract and the other syntaxes, outlaw count of 10.1 (although I know, he appealed to java / OO people kind).

Published by: Marco Gralike April 5, 2011 19:50

Tags: Database

Similar Questions

  • How to enter special characters with the Run statement (@).

    Hello

    Oracle10g (R1)

    NLS_CHARACTERSET = "AL32UTF8.

    When I insert record with special characters like "hastened" with the customer tool insert it works fine, but I run the same INSERT statement execution i.e. statement "SQL > @/ path/Script_File_Name.sql ' special characters has not inserted correctly and it become something like 'h¿ta'.»»

    How to enter special characters correctly race (@) statement?

    Thank you

    If you create a file in Notepad, select the ANSI or the encoding UTF-8 in the dialog box save as.  Copy the Linux file in binary mode. Set the variable NLS_LANG ".» WE8MSWIN1252 ", if the file was saved with the ANSI coding or to. AL32UTF8", if the file was saved with UTF-8 encoding. Be sure to export the variable.  Then, start SQL * more and run the script.  I guess that you are on a U.S. or Western Europe of Windows version.

    Thank you

    Sergiusz

  • Chips and other special characters in the App World descriptions

    How is one makes chips and other special characters in the description of the app in the supplier portal?  I see various descriptions app with chips so I know it's possible.  I tried Googling the answer, but to no avail.  Can someone point me to the documentation for it?

    Thank you

    Lester

    I think it's just the Unicode text, so if you include these characters when you submit the form, they will display.

    Your question is perhaps more on how to insert these characters into the HTML form. To do this, because I need it rarely, I didn't copy and paste of a website where I can find the required text. For example, Google for 'unicode ball' and you can find one of them on one of the first findings of the research, such as the Wikipedia article.

    Some people probably have their systems set up to type Unicode directly from their keyboard, but I never got to determine the modern way to do this (and the last time I checked, years, Unicode in operating systems support was still largely missing).

  • Special characters in the classic report

    Hello

    I'm unable to display special characters in the classic report.

    "For example""" is coming as ' '.

    Is there a way to fix this?

    It seems that use characterset "WE8ISO8859P15" is causing this issue, which is a single-byte character set and so unable to encode these characters.

    Please correct me if I'm wrong.

  • where are the special characters in the new Pages?

    where are the special characters in the new Pages?

    Menubar pages: Edit: Emoji & symbols, or control-command + space combination. Same situation in other Apple applications. In addition, available as a menu item from the menu entry in the menu bar to the right, Finder.

  • Create these special characters in the name of the file as test.? docx or test? PDF in the OS window

    Hello

    Is there a possible way to create these special characters in the name of the file as test.? docx or test? PDF to test the goal?

    I do programming to detect this type of special characters in the file name. This modified script will this type of invalid char file appropriate name, so I need to have the sample to check if my script works.

    I have OSX or Linux. Is there no workaround solution I created in the window itself?

    or can someone create for me so I can go and download instead?

    Thank you and best regards,
    back4more

    Hi Backformore,

    Thanks for posting your question in the Microsoft answers Forum. For any question concerning the development of programs, visit the MSDN hereforums.

  • How to get special characters in the oracle column only

    Hi all

    with spec_tab

    as

    (

    Select ',' col1 of double

    Union

    Select ',' col1 of double

    Union

    Select 'something' double

    )

    Select col1

    of spec_tab

    How to get special characters in the oracle column only

    You mean like this?

    -------------

    WITH spec_tab
         AS (SELECT ',,,,' col1 FROM DUAL
             UNION
             SELECT ',' col1 FROM DUAL
             UNION
             SELECT 'some thing' FROM DUAL)
    SELECT col1
      FROM spec_tab
      where translate('~'||col1,'~0123456789abcdefghijklmnopqrstuvwxyz ','~')<>'~'
    

    Output:

    -----

    COL1

    ,

    ,,,,

    See you soon,.

    Manik.

  • How to remove special characters from the string using translate() without typing all special characters?

    Hi all

    I am trying to remove special characters without the help of regular expressions.

    translate (the column name or string,'!@#$ & * (* () _) * "" :} {?}) >? /, «, » ')

    I want to eliminate this manual process to give all special characters using a chr() or ascii() function.

    Please show me the way.

    Thanks in advance

    Similar to the solution of Michael...

    SQL > ed
    A written file afiedt.buf

    1 with t as (select "[it comes of the #] [more amazing!") Test @# "$* & $%) assuming chain cost $ 5 000' double Str)
    2, i like (select level 1 c from dual connect by level<=>
    3 less
    4 Select + 32 (level-1) double connect by level<=>
    5 less
    6 select + 58 (level-1) double connect by level<=>
    7 less
    8 select + 91 (level-1) double connect by level<=>
    9 less
    10. Select 123 + (level-1) from dual connect by level<=>
    11 less
    12. Select 255 double
    13            )
    14, ts as (select level r, substr (str, level 1) c
    15 t
    16 connect by level<=>
    17             )
    18, tf as (select row_number() (order for r) r
    19                    ,ts.c
    20 TS
    21 I join on (i.c = ascii (ts.c))
    22             )
    23 select replace (sys_connect_by_path(c,'!'),'! ') Str
    24 TF
    25 where connect_by_isleaf = 1
    26 connect r = prior r + 1
    27 * start with r = 1
    SQL > /.

    STR
    -----------------------------------------------------------------------------------------------------------------------
    Thisisthemostamazingtest¸astringcosting5000

    Or something as horrible as this...

    SQL > ed
    A written file afiedt.buf

    1 with t as (select "[it comes of the #] [more amazing!") Test @# "$* & $%) assuming chain cost $ 5 000' double Str)
    2, I like (select replace (sys_connect_by_path (chr (c), 'A'), 'A') as tr)
    3 of)
    4 select c, rownum r
    5 (select 32 + (level-1) as the double connection by level c<=>
    6                         union
    7 select + 58 (level-1) double connect by level<=>
    8                         union
    9 select + 91 (level-1) double connect by level<=>
    10 the union
    11. Select 123 + (level-1) from dual connect by level<=>
    12 union
    13. Select 255 double
    14 tri 1
    15                        )
    16                  )
    17 where connect_by_isleaf = 1
    18 log r = prior r + 1
    19 start with r = 1
    20            )
    21 select translate (str, 'A' |) TR, 'A') as str
    22 * t, I
    SQL > /.

    STR
    --------------------------------------------------------------------
    Thisisthemostamazingtest¸astringcosting5000

  • I have Adobe Acrobat Pro XI.  I went to special characters from the Edit menu and choose some emoji as Favorites, but I can't understand how to insert in the document.  How can I insert special characters into a document?

    How can I insert emoji or other special characters in a document using Adobe Acrobat Pro XI?  I went to special characters from the Edit menu and may not understand how to insert the special character in the document.

    He's not that kind of editor. You can use the characters in a font. If you can select a font with the emoji, which fits into the case, and then enter the characters, it can work.

    This suggests that you try to do TOO MUCH with a PDF file. It is a common thing, but the message should be: everything simply because you can edit a PDF file, does not mean that it is the most effective way for you to do your job.

  • Hello. Can he the word pdf conversion to retain the original character of the special characters of the algorithm? the formulas have special mathematical symbols. Conversion them kept?

    Hello. Can he the word pdf conversion to retain the original character of the special characters of the algorithm? the formulas have special mathematical symbols. Conversion them kept?

    The equations are a problem. If the equation is text, you can be lucky if you have the fonts on your system. Most of the time I have try, the fonts in the equation are garbage. Expect to have to retype the equations and some special characters. Much also depends on the existence of the fonts on your system. Just in my experience, the equations are almost impossible to convert.

  • empty data file with special characters in the name

    Hi all

    I'm having a problem with an empty data file which is in recovery mode.

    Before the following has been a success:
    ALTER database create datafile 'fully_qualified_file_name' as 'fully_qualified_file_name ';
    recover data file "fully_qualified_file_name";
    ALTER database datafile 'fully_qualified_file_name' online;

    But this time it does not work as I get an error:
    ORA-01516: file nonexistent journal, data file, or temporary file
    Using the file id does not work either.

    When I created a record of control file I see the data file has special characters in the name:
    ' / oracle/PRD/112_64/dbs/PSPR3I ^? ^?'

    Since it is empty, it would be possible to create the data file void anothr
    using the:
    ALTER database create datafile ' / oracle/PRD/112_64/dbs/PSPR3I ^? ^?'
    as ' / oracle/PRD/spdata2/r3i_8/r3i.data8';

    and then recover datafile 'fully_qualified_file_name ';
    ALTER database datafile 'fully_qualified_file_name' online;

    How orders oracle faced with special characters?

    Thanks for your advice

    user6737818 wrote:
    Hi all

    I'm having a problem with an empty data file which is in recovery mode.

    Before the following has been a success:
    ALTER database create datafile 'fully_qualified_file_name' as 'fully_qualified_file_name ';
    recover data file "fully_qualified_file_name";
    ALTER database datafile 'fully_qualified_file_name' online;

    But this time it does not work as I get an error:
    ORA-01516: file nonexistent journal, data file, or temporary file
    Using the file id does not work either.

    When I created a record of control file I see the data file has special characters in the name:
    ' / oracle/PRD/112_64/dbs/PSPR3I ^? ^?'

    It should work using a file as the definition of source file number and a new name for the new file. Works for me:

    orcl> alter database create datafile 7 as 'c:\tmp\newname.dbf';
    
    Database altered.
    
    orcl>
    
  • Windows cannot be installed to this disk. the selected disk is a MBR partition table. The EFI system, Windows cannot be installed on GPT disks

    Server 8 installation error "Windows cannot be installed to this disk. the selected disk is a MBR partition table. The EFI system, Windows cannot be installed to GPT disks.

    How do I resolve this problem and install windows 8 as usual? I have several partitions with data... I don't want to delete all partitions and create partitions from scratch and install the os...

    How to get there?

    Windows cannot be installed to this disk. the selected disk is a MBR partition table. The EFI system, Windows cannot be installed to GPT disks.

    This could happen not only windows 8, but also windows 7, windows Server 2008, or 8 server 2008 R2... Troubleshooting steps will be similar for all windows to get this problem...

    I had this problem when installing server 2008 r2 on a dell... T110 server without remove the other partitions or lose all the data on the other drivers, you can solve this problem...

    simply, I have followed these steps using gparted and solved my problem... These measures will be useful for anyone with similar problem... . All the steps that I've documented here... All the steps I've documented here...

    https://www.pcandtablet.com/Windows-8-errors-and-crashes/846/Windows-cannot-be-installed-to-this-disk-the-selected-disk-has-an-MBR-partition-tabl.html

  • The pdf I want to change has all embedded fonts.  When I try to insert a comma, I get the message, "all or part of the selection has no available system fonts.» Cannot add or remove text using the selected font. "Will I still have this problem

    The pdf I want to change has all embedded fonts.  When I try to insert a comma, I get the message, "all or part of the selection has no available system fonts.» Cannot add or remove text using the selected font. "Will I still have this problem if I'm updating from Acrobat X?

    You have the fonts installed in the system. This has not changed. (Having the police is not always enough, but it is certainly necessary).

  • EXTRACT function can be used directly in the CASE statement WHEN

    I wrote the following SELECT statement. The function 'calc_time_diff' is a stored function that subtracts two timestamps and returns the result to the total number of seconds. My DBA does not 'calc_time_diff' as a stored function, then, I replaced the third line (in bold) in the SELECT statement with this:

    COUNTY ( BOX WHEN (extract (DAY OF v_end_ts-v_st_ts) * 24 * 60 * 60) +)

    (extract (HOUR FROM v_end_ts-v_st_ts) * 60 * 60) +.

    (excerpt (v_end_ts-v_st_ts MINUTE) * 60) +.

    extract ((DEUXIÈME à PARTIR de v_end_ts-v_st_ts) < 3600 THEN 1 END) less_than_1_hrs_count

    But the CASE above does not work. It returns the same value as COUNT (*). If the total number of tickets is 32 output will be

    total_tickets less_than_1_hrs_count

    32                                 32

    If I call the "calc_time_diff" then I get the correct result. What I'm doing wrong here?

    **********************************************************************************************************************************************************************

    SELECT

    Count (*) total_tickets,

    COUNTY ( CASE WHEN END of calc_time_diff (t.created_date, h.closed_date) < 3600 THEN 1) less_than_1_hrs_count

    OF n01.cc_ticket_info t

    JOIN IN-HOUSE

    (SELECT ticket_id, MAX (created_date) closed_date

    OF n01.cc_ticket_status_history

    WHERE ticket_status = 'CLOSED' AND created_date > = 18 August 2013 ' AND created_date < (to_date('08/24/2013','MM/DD/YYYY') + interval '1' DAY)

    GROUP BY ticket_id

    ) h

    WE (t.ticket_id = h.ticket_id)

    INNER JOIN n01.cc_ticket_notes n

    WE (n.created_date = h.closed_date)

    WHERE (t. ticket_status = 'NOTIFICATION' t.ticket_status 'CLOSED' = GOLD) AND t.created_date > = 18 August 2013 ' AND t.last_changed < to_date('08/24/2013','MM/DD/YYYY') + interval '1' DAY);

    ***********************************************************************************************************************************************************

    create or replace

    FUNCTION calc_time_diff)

    p_st_ts N01.cc_ticket_info. Type of LAST_CHANGED %,

    p_end_ts N01.cc_ticket_info. Type of LAST_CHANGED %)

    RETURN NUMBER

    AS

    v_no_sec NUMBER;

    v_st_ts N01.cc_ticket_info. Type of LAST_CHANGED %;

    v_end_ts N01.cc_ticket_info. Type of LAST_CHANGED %;

    BEGIN

    v_st_ts: = p_st_ts;

    v_end_ts: = p_end_ts;

    SELECT (extract (DAY OF v_end_ts-v_st_ts) * 24 * 60 * 60) +.

    (extract (HOUR FROM v_end_ts-v_st_ts) * 60 * 60) +.

    (excerpt (v_end_ts-v_st_ts MINUTE) * 60) +.

    excerpt ((SECOND from v_end_ts-v_st_ts)

    IN v_no_sec

    DOUBLE;

    Return v_no_sec;

    END calc_time_diff;

    Hello

    You don't need a function defined by the user or the EXTRACT to find the difference between two timestamps.

    SELECT COUNT (*) AS total_tickets

    , COUNTY ( BOX WHEN h.closed_date < t.created_date="" +="" interval="" '1'=""> )

                         THEN 1

    END

    ) AS less_than_1_hrs_count

    ...

    I hope that answers your question.
    If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the results desired from these data.
    Point where the above query is to produce erroneous results, and explain, using specific examples, how you get the right results from data provided in these places.
    If you change the query at all, post your modified version.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: https://forums.oracle.com/message/9362002

  • BlackBerry 10 Passport Hub - display of special characters (accent) French

    One interesting here, on a passport with 10.3.0.675, French keyboard and using the French language.

    If the subject line of an e-mail contains a French accent character (IE. 'e' or 'e', I have not tested others), then the space between the first two words disappears.

    An example: If the subject of the email is "Basic Test", "Testélémentaire" is displayed, so that the 'Basic Test' is correctly displayed "Basic Test."

    Nothing dramatic, but probably a correction value.

    I can't reproduce the problem with the 10.3.0.908 which I just installed. It has been corrected. Bravo, guys and thank you.

Maybe you are looking for

  • Arguments on OSX does not work

    Hi guys,.I have a MBP with OS x Yosemite, I want to do a service script to send several files as an attachment with thunderbird. I'have try this command in the console but did ' t work:1) open with ' open - a '. open -a /Applications/Thunderbird.app/

  • My running program, it shows a under vi on the screen all the time

    Well guys, my program has a lot of void / vi but only when I try to run something in my program all the time the clay under vi appears on the screen and the others do not... I never see that happen, then why does it appear when I click Next? How can

  • Get a black screen at startup

    Original title: question 2 days back I used tune up utilities to optimize my system... I deleted option hibernate as directed... and went to all the instructions get 100 percnt optimization... but aftr dat when I start my den system after entering th

  • Windows Update KB2868626 with error code 8000ffff

    I have Windows Vista 32-bit.  This update has failed and I tried FixIt, as well as the manual method.  The registry entries mentioned in the manual method were not here there is nothing to change in the registry.  It says "Code 8000FFFF Windows Updat

  • What happens when red error come on my media player when I try to print

    There is a virus win sality.am what can I do?