Мы используем продукт, который хранит аудиторскую информацию в базе данных Oracle в формате XML clob.Ниже приведен формат xml
<Attributes>
<Map>
<entry key="messages">
<value>
<List>
<Message key="err_exception" type="Error">
<Parameters>
<Message key="sailpoint.tools.GeneralException: The application script threw an exception: java.lang.Exception: This request could not be approved as you are the only available approval workgroup member; per CIS policy, a user is not allowed to approve their own request!! BSF info: script at line: 0 column: columnNo" type="Error"/>
</Parameters>
</Message>
</List>
</value>
</entry>
</Map>
</Attributes>
Я использую следующий запрос для получения значений
select * from (select x.*
from identityiq.SPT_IDENTITY_REQUEST att,
xmltable('Attributes'
passing xmltype(att.attributes)
columns Message varchar2(200) path '/Attributes/Map/entry[@key="messages"]/value/List/Message[@key="err_exception"]/Parameters/Message/@key' ) x
where to_date('01/01/1970 00:00:00','mm-dd-yyyy HH24:MI:SS')+(att.created-14400000)/1000/60/60/24 <= to_date('10-01-2019 00:00:00', 'dd-mm-yyyy HH24:MI:SS') and
to_date('01/01/1970 00:00:00','mm-dd-yyyy HH24:MI:SS')+(att.created-14400000)/1000/60/60/24 >= to_date('01-01-2019 00:00:00', 'dd-mm-yyyy HH24:MI:SS')) res
where res.message is not null
and res.message like '%CIS policy%';
Но я получаю следующую ошибку
ORA-19279: XPTY0004 - XQuery dynamic type mismatch: expected singleton sequence - got multi-item sequence
19279. 00000 - "XPTY0004 - XQuery dynamic type mismatch: expected singleton sequence - got multi-item sequence"
*Cause: The XQuery sequence passed in had more than one item.
*Action: Correct the XQuery expression to return a single item sequence.
ЛюбойС благодарностью за помощь