<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Joining XMLTABLE with input table in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/joining-xmltable-with-input-table/qaa-p/780201#M233174</link>
    <description>&lt;P&gt;Perfect! thank you.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Mar 2019 14:26:34 GMT</pubDate>
    <dc:creator>darkwingmcquack</dc:creator>
    <dc:date>2019-03-05T14:26:34Z</dc:date>
    <item>
      <title>Joining XMLTABLE with input table</title>
      <link>https://community.sap.com/t5/technology-q-a/joining-xmltable-with-input-table/qaq-p/780199</link>
      <description>&lt;P&gt;Hi All. &lt;/P&gt;
  &lt;P&gt;In Hana 2.0(sp3) there is this database view SYS.REMOTE_SOURCES &lt;/P&gt;
  &lt;P&gt;It contains all the connection properties for the various connectors configured, however oddly enough some of the values are stored in xml !?!? .. i'm trying to get them out into a relational format.&lt;/P&gt;
  &lt;P&gt;I wrote this and used the xml parser to deconstruct the elements i needed successfully from the xml contained in CONNECTION_INFO column.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/293251-xmltable.jpeg" /&gt;&lt;/P&gt;
  &lt;P&gt;However i get one (the same) row for every entry in REMOTE_SOURCES. &lt;/P&gt;
  &lt;P&gt;Oddly enough you can see the XMLTABLE is parsing the entire table set of rows correctly and clearly independently. Resulting then in a effective cartesian join with the REMOTE_SOURCES single row that was filtered.&lt;/P&gt;
  &lt;P&gt;Problem is that i cannot find a way to join the 2 tables (ie the SYS.REMOTE_SOURCES view, the other the XMLTABLE xml parsed view) in order to not cartesian join for every row in SYS.REMOTE_SOURCES.&lt;/P&gt;
  &lt;P&gt;For the query above i was expecting 1 row back (if i could join the 2 datasets)&lt;/P&gt;
  &lt;P&gt;I then thought i don't need to select from REMOTE_SOURCES, i just do the following&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/293254-xmltable2.jpeg" /&gt;&lt;/P&gt;
  &lt;P&gt;Which works, but now i don't have any of the relational data columns on REMOTE_SOURCES table, like the primary key. I did manage to filter XTABLE .. but only able to filter on elements in the xml not the relational columns. &lt;/P&gt;
  &lt;P&gt;any idea's or syntax i don't know of to filter on XTABLE.REMOTE_SOURCE_NAME ?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2019 17:08:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/joining-xmltable-with-input-table/qaq-p/780199</guid>
      <dc:creator>darkwingmcquack</dc:creator>
      <dc:date>2019-03-04T17:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Joining XMLTABLE with input table</title>
      <link>https://community.sap.com/t5/technology-q-a/joining-xmltable-with-input-table/qaa-p/780200#M233173</link>
      <description>&lt;P&gt;One way to reach your goal is to use the function &lt;A href="https://help.sap.com/viewer/4fe29514fd584807ac9f2a04f6754767/2.0.03/en-US/85ee0084ac014a63aa2680b384466f39.html" target="_blank"&gt;XMLEXTRACTVALUE&lt;/A&gt;. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select remote_source_name,
       xmlextractvalue(connection_info, '/ConnectionProperties/PropertyEntry[3]') as "Driver",
       xmlextractvalue(connection_info, '/ConnectionProperties/PropertyEntry[4]') as "Server",
       xmlextractvalue(connection_info, '/ConnectionProperties/PropertyEntry[5]') as "Port",
       xmlextractvalue(connection_info, '/ConnectionProperties/PropertyEntry[6]') as "DML_Mode"
from sys.remote_sources;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Mar 2019 06:03:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/joining-xmltable-with-input-table/qaa-p/780200#M233173</guid>
      <dc:creator>pfefferf</dc:creator>
      <dc:date>2019-03-05T06:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Joining XMLTABLE with input table</title>
      <link>https://community.sap.com/t5/technology-q-a/joining-xmltable-with-input-table/qaa-p/780201#M233174</link>
      <description>&lt;P&gt;Perfect! thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2019 14:26:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/joining-xmltable-with-input-table/qaa-p/780201#M233174</guid>
      <dc:creator>darkwingmcquack</dc:creator>
      <dc:date>2019-03-05T14:26:34Z</dc:date>
    </item>
  </channel>
</rss>

