convert oracle blob to xml type -
i have experience using mssql 2008 , had move mssql oracle 10g. people designed (oracle) table, has column need extract data from, used blob
type column xml need store.
in mssql have stored xml string in xml
type or used varchar(max)
. assume table mytable
column called mycolumn
varchar(max)
containing <root><a>111</a></root>
if wanted convert varchar(max)
type xml
type write like:
select convert(xml, mycolumn) mytable
if wanted, use xquery data converted column, so:
select convert(xml, mycolumn).query('/root/a')
how accomplish same thing in oracle 10g if mycolumn blob
, without having write stored procedure still making reusable? text in blob uft-8
.
i appreciate assistance, kind of need in hurry.
select xmltype( blob_column, 1 /* character set id. 1 == usascii */ ) xml my_table;
for more character sets: http://www.mydul.net/charsets.html
Comments
Post a Comment