select * from (
SELECT rownum,t.id,
w.*,X.ATTR,X.VALUE,'' CONF,'' CONFVAL
FROM xmltests t,
XMLTABLE ('./*'
PASSING t.data
COLUMNS DFNAME VARCHAR2(30) PATH '@name',
DSGUID VARCHAR2(30) PATH '@id'
)W,
XMLTABLE ('//DIAttributes/*'
PASSING t.data
COLUMNS ATTR VARCHAR2(30) PATH '@name',
VALUE varchar2(30) path '@value',
XPATH XMLTYPE PATH '//*')X
union all
SELECT rownum,t.id,w.*,
'CONFNAME - '||x.attr,'CONFDEFAULT - '||x.value, y.*
FROM xmltests t,
XMLTABLE ('./*'
PASSING t.data
COLUMNS DFNAME VARCHAR2(30) PATH '@name',
DSGUID VARCHAR2(30) PATH '@id'
)W,
XMLTABLE ('//DSConfigurations/DSConfiguration'
PASSING t.data
COLUMNS ATTR VARCHAR2(30) PATH '@name',
VALUE varchar2(30) path '@default',
XPATH XMLTYPE PATH '//*'
)X,
-- XMLTABLE ('//DIAttributes/*'
-- PASSING t.data
-- COLUMNS ATTR VARCHAR2(30) PATH '@name',
-- XPATH XMLTYPE PATH '//*')X,
XMLTABLE ('//DSConfiguration/*'
PASSING x.XPATH
COLUMNS CONFATTR VARCHAR2(50) PATH 'name()',
CONFVALUE VARCHAR2(30) PATH 'text()'
)Y
)
order by rownum
No comments:
Post a Comment