Extract XML data/element from BLOB column using PLSQL
Hi,
I have a table (Oracle 10XE) with two columns, 'ID' (Number) and 'ID_Details' (BLOB). Column 'ID_Details' is used to save XML document.
How do I extract XML document-elements from column type BLOB?
I have tried 'Extract', 'ExtractValue' and 'dburitype.createuri' functions but still getting following errors.
FUNCTION = getStringVal,getXML,getCLOB,getBLOB(873) [873 is csid for Characterset AL32UTF8]
----------------------------------------------------------------------
SELECT Extractvalue(x.ID_Details.FUNCTION()),'/Customer/Name') As XMLSrc FROM TableName x where x.ID = 12345;
SELECT Extract(x.ID_Details.FUNCTION()),'/Customer/Name') As XMLSrc FROM TableName x where x.ID = 12345;
SELECT Extract(x.ID_Details.FUNCTION()),'/Customer/Name/text(') As XMLSrc FROM TableName x where x.ID = 12345;
ORA-22806: not an object or REF
----------------------------------------------------------------------
SELECT Extract( x.ID_Details,'/Customer/Name/text()').Function() As XMLSrc FROM TableName x where x.ID = 12345;
SELECT ExtractValue( x.ID_Details,'/Customer/Name').Function() As XMLSrc FROM TableName x where x.ID = 12345;
ORA-00932: inconsistent datatypes: expected - got -
----------------------------------------------------------------------
select (dburitype.createuri('/Customer/Name')).getclob() As Results from (Select ID_Details from TableName where x.ID = 12345);
ORA-06553: PLS-306: wrong number or types of arguments in call to 'OGC_X'
----------------------------------------------------------------------
Thanks
Avi.