I am trying to parse XML in PL SQL. But getting following error
Error report:
ORA-06550: line 21, column 43:
PL/SQL: ORA-00902: invalid datatype
ORA-06550: line 17, column 1:
PL/SQL: SQL Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
I am trying to run below query
DECLARE
l_xml xmltype:= xmltype('<Table>
<Data>
<DataKey>Test</DataKey>
<DataTypeID>8</DataTypeID>
<DataValue>test1</DataValue>
<Id>eb96c9c1-6236-403d-9afa-6d45ec623dbc</Id>
</Data>
</Table>');
begin
select * FROM
xmltable ('/Table/Data' passing l_xml
columns
DataKey nvarchar2(50) path '/Data/DataKey'
,DataTypeID int, path '/Data/DataTypeID'
, DataValue nvarchar2(1024) path '/Data/DataValue');
end;
/
I am new to PL/SQL, so not able to figure out the error. Can anybody help me here? Thanks