Skip to Main Content

SQL & PL/SQL

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!

varible or update xmltype oracle 12c

helooSep 26 2019 — edited Sep 26 2019

how can i write a script to select a xmltype value from database and then pass to string variable.

<row id='3'><a4 m='86'>852</a4>
<a4 m='86' s='2'>852</a4>
<a4 m='87'>20180102</a4><a4 m='87' s='2'>666</a4>
<a4 m='88'>55555</a4><a4 m='88' s='2'>66666</a4>
<a4 m='89'>999</a4><a4 m='89' s='2'>999</a4>
<a4 m='86'>852</a4><a4 m='86' s='3'>852</a4>
<a4 m='87'>555</a4><a4 m='87' s='3'>333</a4>
<a4 m='88'>55555</a4><a4 m='88' s='3'>33333</a4>
<a4 m='89'>999</a4><a4 m='89' s='3'>999</a4>
<a5>0_dfeddfdfdfdfsd.02_feggx_999</a5>
</row>

how can i convert to string and pass to string varible execute by sqlplus.

because i can't put it into the 1st parameter of replace function.

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

update table_A set xmlcol= xmltype( replace(<a5> node value here....</a5>, 'XYZ','dfeddfdfdfdfsd')) where id='3'

how can i select xmltype a5 node and pass to 1st paramter of replace function above using oracle 12c sqlplus

Comments
Post Details
Added on Sep 26 2019
3 comments
152 views