Quantcast
Channel: SCN : Discussion List - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 5653

XML Search in HANA

$
0
0

Hi,

I have a use case where I have data stored as XML data type (BLOB) in a HANA table and we want to search specific nodes for specific values. One sample XML value would be

<?xml version="1.0" encoding="utf-8" ?>
<DocumentAttributes>
  <LetterID>473</LetterID>
  <DescriptionTexts>
    <DescriptionText1>
      <VersionNumber>493</VersionNumber>
      <VersionDate>20120220</VersionDate>
      <VersionTime>185412</VersionTime>
      <User>ABC</User>
      <LetterID>483</LetterID>
    </DescriptionText1>
  </DescriptionTexts>
</DocumentAttributes>

For example in SQL Server I'm able to use the following query to find out the desired result:

select*fromdbo.XML_DATENwhereXML_Data.value('(/DocumentAttributes/LetterID)[1]','int')= 473

In this example the query returns me all rows where under the node DocumentAttributes the LetterID is set to 473.

Is something similar also possible with HANA either over CE Functions or SQL Script? I searched the SQL reference without any success.

Thanks and Regards,
Daniel


Viewing all articles
Browse latest Browse all 5653

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>