Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear experts,
I have CLOB column in the table and which is having data like below:
<billingDetails>
<createDate>2021-01-10T16:01:22.000-07:00</createDate>
<dueDate>2021-02-10T16:01:22.000-07:00</dueDate>
<fromDate>2021-02-12T16:01:22.000-07:00</fromDate>
<toDate>2021-03-12T16:01:22.000-07:00</toDate>
<mailed>false</mailed>
<autopay>true</autopay>
<reason><=$0 balance></reason>
</billingDetails>

I would like to replace node
<reason><=$0 balance></reason>
into
<reason>not valid</reason>

Means updated xml should be like below
<billingDetails>
<createDate>2021-01-10T16:01:22.000-07:00</createDate>
<dueDate>2021-02-10T16:01:22.000-07:00</dueDate>
<fromDate>2021-02-12T16:01:22.000-07:00</fromDate>
<toDate>2021-03-12T16:01:22.000-07:00</toDate>
<mailed>false</mailed>
<autopay>true</autopay>
<reason>not valid</reason>
</billingDetails>


What I have tried:

I have used below query but getting exception 
<pre>UPDATE tab1 SET clob_column =
   UPDATEXML(clob_column,
   '/billingDetails/reason/text()','not valid')
   WHERE sid =1

Exception:
[Error] Execution (20: 4): ORA-00932: inconsistent datatypes: expected - got -

Please help me to resolve and update xml node?
Thanks in advance
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900