mmoore
asked on
XMLTABLE XQuery dynamic type mismatch
I do understand why this throws this error:
ORA-19279: XPTY0004 - XQuery dynamic type mismatch: expected singleton sequence - got multi-item sequence
What I would like to get as a result is a record with a nested table column.
I would like the result set to look something like the below image where Operator is a nested table column.
I tried using COLLECT but there seems to be a type mismatch.
Thanks,
Mike
ORA-19279: XPTY0004 - XQuery dynamic type mismatch: expected singleton sequence - got multi-item sequence
What I would like to get as a result is a record with a nested table column.
SELECT x.*
FROM XMLTABLE (
'/batch/testload'
PASSING xmltype (q'[<batch>
<testload>
<Operator>IN</Operator>
<Operator>OUT</Operator>
<Attribute>DoorsDouble</Attribute>
</testload>
<testload>
<Operator>IN</Operator>
<Attribute>WindowsSingleMultiple</Attribute>
</testload>
</batch>]')
COLUMNS operator1 VARCHAR2 (200) PATH 'Operator',
attribute2 VARCHAR2 (200) PATH 'Attribute') x;
I would like the result set to look something like the below image where Operator is a nested table column.
I tried using COLLECT but there seems to be a type mismatch.
Thanks,
Mike
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER