Hi,
I'm new to oracle and would like to know how can I read XML in oracle like SQL SERVER Query. I know how I can do it in SQL Server (see the below code).
Would anyone be able to help me out please?
declare @XMLDoc xml
set @XMLDoc = '
<list>
<item uprn="64333" address="abcd" />
<item uprn="56789" address="xyz" />
<item uprn="12343" address="xxxx" />
</list>'
SELECT x.Item.value('@uprn', 'varchar(50)') uprns, x.Item.value('@address', 'varchar(50)') address FROM @XMLDoc.nodes('/list/item') AS x(Item);
I'm new to oracle and would like to know how can I read XML in oracle like SQL SERVER Query. I know how I can do it in SQL Server (see the below code).
Would anyone be able to help me out please?
declare @XMLDoc xml
set @XMLDoc = '
<list>
<item uprn="64333" address="abcd" />
<item uprn="56789" address="xyz" />
<item uprn="12343" address="xxxx" />
</list>'
SELECT x.Item.value('@uprn', 'varchar(50)') uprns, x.Item.value('@address', 'varchar(50)') address FROM @XMLDoc.nodes('/list/item') AS x(Item);