update the node value [message #479793] |
Tue, 19 October 2010 06:06 |
madhavi babburi
Messages: 117 Registered: May 2009 Location: Hyderabad
|
Senior Member |
|
|
Hi,
I have the below xml as a record in oracle table. I want to update the "job" (exists in REF_MAKE_USER Node) value as 0.
<?xml version="1.0"?>
<ROWSET>
<ROW>
<REFGROUP_T>
<VERS_MAJOR>1</VERS_MAJOR>
<VERS_MINOR>0</VERS_MINOR>
<REFNAME>REFRESH_TESTFL_5MINS</REFNAME>
<OWNER_NUM>68</OWNER_NUM>
<REFOWNER>REPADMIN</REFOWNER>
<REFGROUP>241</REFGROUP>
<REF_MAKE_USER>[Edit MC: Remove useless long data for just "Something"]</REF_MAKE_USER>
</REFGROUP_T>
</ROW>
</ROWSET>
Is it possible to update the part of value in node?
If yes, please let me know.
Thanks & Regards,
Madhavi.
[Updated on: Tue, 19 October 2010 06:25] by Moderator Report message to a moderator
|
|
|
Re: update the node value [message #479797 is a reply to message #479793] |
Tue, 19 October 2010 06:23 |
|
Michel Cadot
Messages: 68732 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Keep your lines in 80 character width.
SQL> with data as (
2 select xmltype('
3 <ROWSET>
4 <ROW>
5 <REFGROUP_T>
6 <VERS_MAJOR>1</VERS_MAJOR>
7 <VERS_MINOR>0</VERS_MINOR>
8 <REFNAME>REFRESH_TESTFL_5MINS</REFNAME>
9 <OWNER_NUM>68</OWNER_NUM>
10 <REFOWNER>REPADMIN</REFOWNER>
11 <REFGROUP>241</REFGROUP>
12 <REF_MAKE_USER>Something</REF_MAKE_USER>
13 </REFGROUP_T>
14 </ROW>
15 </ROWSET>') val from dual
16 )
17 select updatexml(val,'//REF_MAKE_USER/text()','### MY JOB ###') val
18 from data
19 /
VAL
--------------------------------------------------------------------------------
<ROWSET><ROW><REFGROUP_T><VERS_MAJOR>1</VERS_MAJOR><VERS_MINOR>0</VERS_MINOR><RE
FNAME>REFRESH_TESTFL_5MINS</REFNAME><OWNER_NUM>68</OWNER_NUM><REFOWNER>REPADMIN<
/REFOWNER><REFGROUP>241</REFGROUP><REF_MAKE_USER>### MY JOB ###</REF_MAKE_USER><
/REFGROUP_T></ROW></ROWSET>
Regards
Michel
[Updated on: Tue, 19 October 2010 06:24] Report message to a moderator
|
|
|
Re: update the node value [message #480112 is a reply to message #479797] |
Thu, 21 October 2010 04:33 |
madhavi babburi
Messages: 117 Registered: May 2009 Location: Hyderabad
|
Senior Member |
|
|
Thank you Michel for response.
But i need to keep total long data in the node (REF_MAKE_USER). Thats the metadata of refresh group. I want just update the JOB value as 0 in the node. If i remove total data in node, this xml data is not useful to create a refresh group in another site.
<ROWSET>
<ROW>
<REFGROUP_T>
<VERS_MAJOR>1</VERS_MAJOR>
<VERS_MINOR>0</VERS_MINOR>
<REFNAME>REFRESH_TESTFL_5MINS</REFNAME>
<OWNER_NUM>68</OWNER_NUM>
<REFOWNER>REPADMIN</REFOWNER>
<REFGROUP>241</REFGROUP>
<REF_MAKE_USER>dbms_refresh.make('"REPADMIN"."REFRESH_TESTFL_5MINS"',list=>null,next_date=>null,interval=>null,implicit_destroy=>FALSE,lax=>FALSE,job=>462,rollback_seg=>NULL,push_deferred_rpc=>TRUE,refresh_after_errors=>TRUE,purge_option => 1,parallelism => 0,heap_size => 0);</REF_MAKE_USER>
</REFGROUP_T>
</ROW>
</ROWSET>
I'm expecting to update only JOB value in the node.
Is it possible? If yes, please let me know the function/method.
Thanks & Regards,
Madhavi.
|
|
|
|
|
|