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

Home -> Community -> Usenet -> c.d.o.server -> Re: Problem with XMLType attribibutes? please confirm

Re: Problem with XMLType attribibutes? please confirm

From: Maxim Demenko <mdemenko_at_gmail.com>
Date: Mon, 01 Aug 2005 22:25:12 +0200
Message-ID: <dcm0eo$i04$02$1@news.t-online.com>


Andrew Hardy schrieb:
> Ko van der Sloot wrote:
>

>> Hello,
>> we encountered a very strange problem with searching in our XMLType
>> database.
>>
>> Our configuration is:
>> Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
>> With the Partitioning, OLAP and Oracle Data Mining options
>> JServer Release 9.2.0.4.0 - Production
>>
>> Below you will find a very simple example that demonstrates the problem.
>> It seems that a diacritic in an attribute confuses Oracle, and makes
>> some record "invisable". We expect the query to find both records in the
>> table.
>>
>> Please try this and confirm that the problem is real, or that we have
>> some misconception about Oracle. (and if so: what do we do wrong?)
>>
>> Also we are very much interested to know how Oracle 10 handles this.
>>
>> The input is UTF8 ,and NSL_LANG is set to American_america.AL32UTF8
>>
>> Here is the example script:
>> ====================================================
>> drop table my_table;
>>
>> create table my_table ( doc_id NUMBER, data_char xmltype );
>>
>> insert into my_table values( 1, XMLType(
>> '<document>
>>    <au first="Rüdiger" id="1">Rüdiger</au>
>>  </document>' ) );
>>
>> insert into my_table values( 2, XMLType(
>> '<document>
>>    <au first="Ruediger" id="1">Rüdiger</au>
>>  </document>' ) );
>>
>> create index my_table_idx on my_table(data_char) indextype is
>> ctxsys.context;
>>     
>> select data_char from my_table where contains(data_char,'1 inpath(
>> //au/@id )' ) > 0;

>
> On my box:
>
> Connected to Oracle Database 10g Release 10.1.0.3.0
> Connected as hardya
>
>
> SQL>
>
> Table created
>
> 1 row inserted
>
> 1 row inserted
>
> Index created
>
> DATA_CHAR
> --------------------------------------------------------------------------------
>
> <document>
> <au first="R?diger" id="1">R?diger</au>
> </document>
>
> <document>
> <au first="Ruediger" id="1">R?diger</au>
> </document>
>
>
> SQL>
>

On my box:

scott_at_ORA92>

Table created.

1 row created.

1 row created.

Index created.

scott_at_ORA92> select data_char from my_table where contains(data_char,'1 inpath(
//au/@id )' ) > 0; 2

DATA_CHAR




<document>

    <au first="Ruediger" id="1">Rüdiger</au>   </document>

<document>

Verify pls the character set of your database. If your character set does contain 'ü', you should be able to see proper results.

Best regards

Maxim Received on Mon Aug 01 2005 - 15:25:12 CDT

Original text of this message

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