updateXML of a string containing an apostrophe
703772May 27 2009 — edited May 29 2009hi 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