<?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>topic Re: How to perform join and query with composite keys in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-perform-join-and-query-with-composite-keys/m-p/736737#M201</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Than,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you want to take a look at QueryDefs (&lt;A class="link-titled" href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Geodatabase#querydef" title="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Geodatabase#querydef"&gt;ProConcepts Geodatabase · Esri/arcgis-pro-sdk Wiki · GitHub&lt;/A&gt;&amp;nbsp;). &amp;nbsp;This is another join construct in ArcGIS. &amp;nbsp;It works with datasets that come from the same geodatabase. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are a lot of different query constructs available in the Pro SDK. &amp;nbsp;In addition to just a basic query on a single table using Table.Search, we support QueryDefs, Joins, QueryTables, and QueryLayers. &amp;nbsp;If the document above doesn't clarify the difference enough, my&amp;nbsp;colleagues and I gave a session on the Geodatabase SDK at the (virtual) DevSummit this year:&amp;nbsp;&lt;A class="jivelink11" href="https://www.youtube.com/watch?v=EKx1kzQARlM&amp;amp;list=PLaPDDLTCmy4Ys8vfmC7DbX3FHSsyosvh7&amp;amp;index=151&amp;amp;t=0s" title="https://www.youtube.com/watch?v=EKx1kzQARlM&amp;amp;list=PLaPDDLTCmy4Ys8vfmC7DbX3FHSsyosvh7&amp;amp;index=151&amp;amp;t=0s"&gt;https://www.youtube.com/watch?v=EKx1kzQARlM&amp;amp;list=PLaPDDLTCmy4Ys8vfmC7DbX3FHSsyosvh7&amp;amp;index=151&amp;amp;t=0s&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The section on Queries starts at 14:40.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 May 2020 16:16:00 GMT</pubDate>
    <dc:creator>RichRuh</dc:creator>
    <dc:date>2020-05-20T16:16:00Z</dc:date>
    <item>
      <title>How to perform join and query with composite keys</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-perform-join-and-query-with-composite-keys/m-p/736736#M200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have basin feature class, platform table in my geodatabase.&lt;/P&gt;&lt;P&gt;They have composite keys relationships, (meaning two keys as primary keys)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example sql query statement&amp;nbsp;I want to perform in sdk is&amp;nbsp;&lt;SPAN style="color: #99cc00;"&gt;&amp;nbsp;select p.id1, p.basinname, p.segmentname from platform p LEFT JOIN basin b ON p.id1 = b.id1 and p.id2 = b.id2 where p.category = 'thirdparty'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; "&gt;Refer&lt;SPAN&gt;&amp;nbsp;to that statement id1, id2 are the composite keys.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; "&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; "&gt;&lt;SPAN&gt;How can I do this in arcgis pro sdk?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; "&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; "&gt;I tried and referred to sdk doco geodatabase api =&amp;gt;&amp;nbsp;&lt;A class="link-titled" href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Geodatabase#joins" title="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Geodatabase#joins"&gt;ProConcepts Geodatabase · Esri/arcgis-pro-sdk Wiki · GitHub&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; "&gt;And I can't figure it out how to manage with arcgis pro sdk?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2020 08:02:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-perform-join-and-query-with-composite-keys/m-p/736736#M200</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-05-20T08:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to perform join and query with composite keys</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-perform-join-and-query-with-composite-keys/m-p/736737#M201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Than,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you want to take a look at QueryDefs (&lt;A class="link-titled" href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Geodatabase#querydef" title="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Geodatabase#querydef"&gt;ProConcepts Geodatabase · Esri/arcgis-pro-sdk Wiki · GitHub&lt;/A&gt;&amp;nbsp;). &amp;nbsp;This is another join construct in ArcGIS. &amp;nbsp;It works with datasets that come from the same geodatabase. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are a lot of different query constructs available in the Pro SDK. &amp;nbsp;In addition to just a basic query on a single table using Table.Search, we support QueryDefs, Joins, QueryTables, and QueryLayers. &amp;nbsp;If the document above doesn't clarify the difference enough, my&amp;nbsp;colleagues and I gave a session on the Geodatabase SDK at the (virtual) DevSummit this year:&amp;nbsp;&lt;A class="jivelink11" href="https://www.youtube.com/watch?v=EKx1kzQARlM&amp;amp;list=PLaPDDLTCmy4Ys8vfmC7DbX3FHSsyosvh7&amp;amp;index=151&amp;amp;t=0s" title="https://www.youtube.com/watch?v=EKx1kzQARlM&amp;amp;list=PLaPDDLTCmy4Ys8vfmC7DbX3FHSsyosvh7&amp;amp;index=151&amp;amp;t=0s"&gt;https://www.youtube.com/watch?v=EKx1kzQARlM&amp;amp;list=PLaPDDLTCmy4Ys8vfmC7DbX3FHSsyosvh7&amp;amp;index=151&amp;amp;t=0s&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The section on Queries starts at 14:40.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2020 16:16:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-perform-join-and-query-with-composite-keys/m-p/736737#M201</guid>
      <dc:creator>RichRuh</dc:creator>
      <dc:date>2020-05-20T16:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to perform join and query with composite keys</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-perform-join-and-query-with-composite-keys/m-p/736738#M202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank &lt;A href="https://community.esri.com/migrated-users/44320" target="_blank"&gt;Rich Ruh&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look like I have to read through whole block, that QueryDef object solve that composite join issue.&lt;/P&gt;&lt;P&gt;I am so much focus on Joint section in the article and miss that section.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the working code snippet, incase if someone encounter similar situation.&lt;/P&gt;&lt;P&gt;gdb.Evaluate does not work for me, not sure why but It does work with opentable and search function combination.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;  QueryDef queryDef &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;QueryDef&lt;/SPAN&gt;
                        &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
                            Tables &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; tableJoinStatement&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                            SubFields &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; retrieveSelect&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                            WhereClause &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;_CurrentWhereClause
                        &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

                        QueryTableDescription queryTableDescription &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;QueryTableDescription&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;queryDef&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
                        &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
                            Name &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"PlatformBasinJoin"&lt;/SPAN&gt;

                        &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍

Table queryTable &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gdb&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;OpenQueryTable&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;queryTableDescription&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
                        &lt;SPAN class="keyword token"&gt;using&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;RowCursor rowCursor &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; queryTable&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Search&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
                        &lt;SPAN class="comment token"&gt;//using (RowCursor rowCursor = gdb.Evaluate(queryDef, false))//does not work, expected field not found error&lt;/SPAN&gt;
                        &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
                            &lt;SPAN class="keyword token"&gt;while&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;rowCursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;MoveNext&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
                            &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
                                &lt;SPAN class="keyword token"&gt;using&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Row row &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; rowCursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Current&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
                                &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;


&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:23:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-perform-join-and-query-with-composite-keys/m-p/736738#M202</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T07:23:50Z</dc:date>
    </item>
  </channel>
</rss>

