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!

how to replace the . in my xml string or varchar2 string

527733Dec 10 2009 — edited Dec 10 2009
Hi All,

I need to replace the "." in my code with an "_" , here is my code

set serveroutput on
declare
payloadXml long;
xdoc xmltype;
begin
payloadXml := '<?xml version="1.0"?><CHAT.OBJMESSAGE_TYP><FROM_USERID>abcdabcd</FROM_USERID><TO_USERID>asdfghjk</TO_USERID><MESSAGE>HI THIS IS SOME MESSAGE</MESSAGE></CHAT.OBJMESSAGE_TYP>';
xdoc := new xmltype(payloadXml);
dbms_output.put_line(xdoc.extract('/CHAT_OBJMESSAGE_TYP/MESSAGE/text()').getStringVal());
end;
/


Now in this line I have <CHAT.OBJMESSAGE_TYP> , this i need to change it to
<CHAT_OBJMESSAGE_TYP> and </CHAT_OBJMESSAGE_TYP>

This I have to do it in code.

any suggestions on how to do that ..

TIA
This post has been answered by Arunkumar Ramamoorthy-Oracle on Dec 10 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 7 2010
Added on Dec 10 2009
7 comments
720 views