How to extract only the subtag in this xml element

with this query I can select the content of tag select xmltype( ‘<?xml version="1.0"?> <ROWSET> <ROW> <PERSON_NUMBER>1000142</PERSON_NUMBER> <LOAN_1>25000</LOAN_1> </ROW> <ROW> <PERSON_NUMBER>1000142</PERSON_NUMBER> <LOAN_1>25000</LOAN_1> </ROW> </ROWSET>’ ).extract( ‘/ROWSET/ROW’ ) .getstringval() p# from dual; <PERSON_NUMBER>1000142</PERSON_NUMBER><LOAN_1>25000</LOAN_1><PERSON_NUMBER>1000142</PERSON_NUMBER><LOAN_1>25000</LOAN_1> but what I want is to have a list of the sub-tag. the expected result for this example would be: PERSON_NUMBER, LOAN_1 code… Read More How to extract only the subtag in this xml element

Not able to read values from xml in postgres

I am trying to read from a xml and insert them in a temporary table and return that table as a result. Below is the Postgres function I am trying with CREATE OR REPLACE FUNCTION public.xml( ) RETURNS TABLE(name character varying, description character varying, parentpid character varying, level integer, nodenumber character varying, displayorder integer, iscustom… Read More Not able to read values from xml in postgres