I am trying to query one XML column in DB2 but not getting the desired output. I want to fetch all the records where Name='Inder'
Below is the structure of my database -
Table Name - CUSTOMER
Column Name - XML_DATA
Structure of XML -
<ns2:CustomerRequest xmlns:ns2=http://en.nomura.customer.submit>
<CustomerData>
<Name>Inder</Name>
and this is the query which i am trying -
SELECT * FROM CUSTOMER WHERE XMLExists ('$d//CustomerData[Name="Inder"]' passing XML_DATA as "d")
Below is the error - Code: -16011, SQL State: 10507] The result of an intermediate step expression in an XQuery path expression contains an atomic value. Error QName=err:XPTY0019.. SQLCODE=-16011, SQLSTATE=10507, DRIVER=4.22.29
- [Code: -727, SQL State: 56098] An error occurred during implicit system action type "2". Information returned for the error includes SQLCODE "-16011", SQLSTATE "10507" and message tokens "10507".. SQLCODE=-727, SQLSTATE=56098, DRIVER=4.22.29
Can anyone please help me with the query