Home » Developer & Programmer » JDeveloper, Java & XML » XML to Oracle Plsql Conversion (Oracle 10g)
XML to Oracle Plsql Conversion [message #513216] Fri, 24 June 2011 08:10 Go to next message
baskar.gouda@sun.com
Messages: 4
Registered: June 2009
Location: CHENNAI
Junior Member
Hi,
Does anybody know how to revert the following so that the output should be '<testPrice>1000</testPrice>'.


select htf.escape_sc('<testPrice>1000</testPrice>') from dual;
&lt;testPrice&gt;1000&lt;/testPrice&gt;

Thanks-Bhaskar
Re: XML to Oracle Plsql Conversion [message #513217 is a reply to message #513216] Fri, 24 June 2011 08:15 Go to previous messageGo to next message
Michel Cadot
Messages: 58597
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
select '<testPrice>1000</testPrice>' from dual;

Regards
Michel

Re: XML to Oracle Plsql Conversion [message #513222 is a reply to message #513217] Fri, 24 June 2011 08:41 Go to previous messageGo to next message
baskar.gouda@sun.com
Messages: 4
Registered: June 2009
Location: CHENNAI
Junior Member
Hi ,

I want to get <testPrice>1000</testPrice>
from '&lt;testPrice&gt;1000&lt;/testPrice&gt;'
Thanks-Bhaskar Gouda
Re: XML to Oracle Plsql Conversion [message #513225 is a reply to message #513222] Fri, 24 June 2011 09:02 Go to previous messageGo to next message
Michel Cadot
Messages: 58597
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
There is no built-in function but there are many in different language on the web, you can easily find and convert them in PL/SQL.

Regards
Michel
Re: XML to Oracle Plsql Conversion [message #513226 is a reply to message #513222] Fri, 24 June 2011 09:05 Go to previous message
Maaher
Messages: 7041
Registered: December 2001
Senior Member
DBMS_XMLGEN could help you out:
SQL> set define off
SQL> column data format a40
SQL> select dbms_xmlgen.convert('&lt;testPrice&gt;1000&lt;/testPrice&gt;'
  2                            , 1 -- dbms_xmlgen.ENTITY_DECODE
  3                            ) data
  4  from dual
  5  /

DATA
----------------------------------------
<testPrice>1000</testPrice>



Edit: correct reference to dbms_xml.ENTITY_DECODE.

[Updated on: Fri, 24 June 2011 09:07]

Report message to a moderator

Previous Topic: Java Programs hang on startup
Next Topic: Read XML Files!
Goto Forum:
  


Current Time: Mon Jul 28 00:52:32 CDT 2014

Total time taken to generate the page: 0.04069 seconds