Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

updateXML of a string containing an apostrophe

703772May 27 2009 — edited May 29 2009
hi all,
i'm dealing with this problem:

the table bk_proc_config contains the following record:

SELECT xml_config FROM bk_proc_config

<CONFIG>
<CONDITION>TIPO_DISTINTA IN ('one','two')</CONDITION>
</CONFIG>')

where xml_config is a SYS.XMLTYPE

i would like to have a script that add a new condition:

<CONFIG>
<CONDITION>TIPO_DISTINTA IN ('one','two',*'three'*)</CONDITION>
</CONFIG>')

i've tried the following:

UPDATE bk_proc_config
SET xml_config = updatexml(
xml_config,
'/CONFIG/CONDITION/text()',
'TIPO_DISTINTA IN (''one'',''two'',''three'')'
)

but the result is not exactly what i expected:

<CONFIG>
<CONDITION>TIPO_DISTINTA IN (&_apos;one&_apos;,&_apos;two&_apos;,&_apos;three&_apos;)</CONDITION>
</CONFIG>')

(ie a sequence of &_apos; (without the underscore char of course!) appears, instead of a simple apostrophe)

is there a way to 'escape' the apostrophe characters?

thanks for any help you can provide!

massimo
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 26 2009
Added on May 27 2009
4 comments
1,679 views