<?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: Evaluate a QueryDef with joined tables or featureClass from a Feature Layer URL in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/evaluate-a-querydef-with-joined-tables-or/m-p/1566059#M12385</link>
    <description>&lt;P&gt;QueryDef mainQueryDef = new QueryDef&lt;BR /&gt;{&lt;BR /&gt;Tables = $"DD_PLAN_1_STUDENT_COUNT LEFT JOIN ({"SELECT DD_PLAN_1_STA_ENROLLMENT.SCHL_ATND AS SCHOOL, Sum( DD_PLAN_1_STA_ENROLLMENT.TOTAL_ENROLLMENT) AS TOTALENROLL, SUM(DD_PLAN_1_STA_ENROLLMENT.GPK+DD_PLAN_1_STA_ENROLLMENT.GK+DD_PLAN_1_STA_ENROLLMENT.G1+" +&lt;BR /&gt;"DD_PLAN_1_STA_ENROLLMENT.G2+DD_PLAN_1_STA_ENROLLMENT.G3+DD_PLAN_1_STA_ENROLLMENT.G4+DD_PLAN_1_STA_ENROLLMENT.G5+DD_PLAN_1_STA_ENROLLMENT.G6) AS [PK-6], SUM(DD_PLAN_1_STA_ENROLLMENT.GPK) AS GPK, SUM(DD_PLAN_1_STA_ENROLLMENT.GK) AS GK, SUM(DD_PLAN_1_STA_ENROLLMENT.G1) AS G1, SUM(DD_PLAN_1_STA_ENROLLMENT.G2) AS G2, " +&lt;BR /&gt;"SUM(DD_PLAN_1_STA_ENROLLMENT.G3) AS G3, SUM(DD_PLAN_1_STA_ENROLLMENT.G4) AS G4, SUM(DD_PLAN_1_STA_ENROLLMENT.G5) AS G5, SUM(DD_PLAN_1_STA_ENROLLMENT.G6) AS G6, SUM(DD_PLAN_1_STA_ENROLLMENT.G7) AS G7, SUM(DD_PLAN_1_STA_ENROLLMENT.G8) AS G8," +&lt;BR /&gt;" SUM(DD_PLAN_1_STA_ENROLLMENT.G9) AS G9, SUM(DD_PLAN_1_STA_ENROLLMENT.G10) AS G10, SUM(DD_PLAN_1_STA_ENROLLMENT.G11) AS G11, SUM(DD_PLAN_1_STA_ENROLLMENT.G12) AS G12 FROM DD_PLAN_1_STA_ENROLLMENT GROUP BY DD_PLAN_1_STA_ENROLLMENT.SCHL_ATND"}) AS DD_ENROLLMENT ON DD_PLAN_1_STUDENT_COUNT.SCHL_NAME = DD_ENROLLMENT.SCHOOL",&lt;BR /&gt;SubFields = "DD_PLAN_1_STUDENT_COUNT.SCHL_NAME AS SCHOOL, " +&lt;BR /&gt;"DD_PLAN_1_STUDENT_COUNT.GRD_RANGE AS GRADES_SERVED, " +&lt;BR /&gt;"DD_ENROLLMENT.TOTALENROLL + DD_PLAN_1_STUDENT_COUNT.TOTAL AS ENROLLMENT, " +&lt;BR /&gt;"DD_PLAN_1_STUDENT_COUNT.[RS], " +&lt;BR /&gt;"DD_PLAN_1_STUDENT_COUNT.[OD_UM], " +&lt;BR /&gt;"DD_ENROLLMENT.PK6, " +&lt;BR /&gt;"DD_ENROLLMENT.GPK, DD_ENROLLMENT.GK, " +&lt;BR /&gt;"DD_ENROLLMENT.G1, DD_ENROLLMENT.G2, " +&lt;BR /&gt;"DD_ENROLLMENT.G3, DD_ENROLLMENT.G4, DD_ENROLLMENT.G5, " +&lt;BR /&gt;"DD_ENROLLMENT.G6, DD_ENROLLMENT.G7, " +&lt;BR /&gt;"DD_ENROLLMENT.G8, DD_ENROLLMENT.G9, " +&lt;BR /&gt;"DD_ENROLLMENT.G10, DD_ENROLLMENT.G11, DD_ENROLLMENT.G12",&lt;BR /&gt;WhereClause = schoolClause&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;It throws errors: invalid SQL statement. How can I resolve this issue using ArcGIS Pro add-ins in WPF?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 08 Dec 2024 18:41:30 GMT</pubDate>
    <dc:creator>PARTHASARATHIU</dc:creator>
    <dc:date>2024-12-08T18:41:30Z</dc:date>
    <item>
      <title>Evaluate a QueryDef with joined tables or featureClass from a Feature Layer URL</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/evaluate-a-querydef-with-joined-tables-or/m-p/1362223#M10893</link>
      <description>&lt;DIV&gt;I have an issue when I use the &lt;STRONG&gt;Evaluate&lt;/STRONG&gt; method with a &lt;STRONG&gt;QueryDef&lt;/STRONG&gt; with joined tables or featureClass from a &lt;STRONG&gt;Feature Layer&lt;/STRONG&gt;.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Everything works great when I use this code with a &lt;STRONG&gt;GDB&lt;/STRONG&gt; or an &lt;STRONG&gt;SDE connection&lt;/STRONG&gt;, but it doesn't work with a &lt;STRONG&gt;Feature Layer&lt;/STRONG&gt; from &lt;STRONG&gt;ArcGIS Enterprise&lt;/STRONG&gt;.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;https://myserver.com/server/rest/services/myweblayer/FeatureServer&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The connection to this &lt;STRONG&gt;Feature Layer&lt;/STRONG&gt; works when I use a simple &lt;STRONG&gt;QueryFilter&lt;/STRONG&gt;.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Here is a simplified version of my code :&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;using (Table oTable1 = oGeodatabase.OpenDataset&amp;lt;Table&amp;gt;(oTableDefinition.GetName()))
using (FeatureClass oFeatureClass = oGeodatabase.OpenDataset&amp;lt;FeatureClass&amp;gt;(oFeatureClassDefinition.GetName()))
{
	sTables = string.Format("{0} LEFT JOIN {1} ON {1}.MY_KEY = {0}.MY_KEY", oTable1.GetName(), oFeatureClass2.GetName());

	oQueryDef = new QueryDef
	{
		Tables = sTables,
		SubFields = sSubFields,
		WhereClause = sWhere,
	};

	using (RowCursor oRowCursor = oGeodatabase.Evaluate(oQueryDef, false))
	{
	}
}&lt;/LI-CODE&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;My &lt;STRONG&gt;Feature Layer&lt;/STRONG&gt; is on &lt;STRONG&gt;ArcGIS Enterprise&lt;/STRONG&gt; but it might be the same for &lt;STRONG&gt;ArcGIS Online&lt;/STRONG&gt;.&lt;/DIV&gt;</description>
      <pubDate>Mon, 18 Dec 2023 20:06:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/evaluate-a-querydef-with-joined-tables-or/m-p/1362223#M10893</guid>
      <dc:creator>RejeanLabbe</dc:creator>
      <dc:date>2023-12-18T20:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate a QueryDef with joined tables or featureClass from a Feature Layer URL</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/evaluate-a-querydef-with-joined-tables-or/m-p/1362276#M10894</link>
      <description>&lt;P&gt;QueryDef is not supported in a feature service datastore.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2023 21:19:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/evaluate-a-querydef-with-joined-tables-or/m-p/1362276#M10894</guid>
      <dc:creator>Aashis</dc:creator>
      <dc:date>2023-12-18T21:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate a QueryDef with joined tables or featureClass from a Feature Layer URL</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/evaluate-a-querydef-with-joined-tables-or/m-p/1362751#M10905</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/221628"&gt;@Aashis&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;Amr from Esri Canada told me about the Join class from the ArcGIS.Core.Data namespace and that did the trick.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;using (Geodatabase sourceGeodatabase = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri("Path \\ to \\Geodatabase \\ one"))))
    using (Geodatabase destinationGeodatabase = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri("Path \\ to \\Geodatabase \\ two"))))
    using (Table sourceTable = sourceGeodatabase.OpenDataset&amp;lt;Table&amp;gt;("State"))
    using (Table destinationTable = destinationGeodatabase.OpenDataset&amp;lt;Table&amp;gt;("Cities"))
    {
      Field primaryKeyField = sourceTable.GetDefinition().GetFields().FirstOrDefault(field =&amp;gt; field.Name.Equals("State.State_Abbreviation"));
      Field foreignKeyField = destinationTable.GetDefinition().GetFields().FirstOrDefault(field =&amp;gt; field.Name.Equals("Cities.State"));

      VirtualRelationshipClassDescription virtualRelationshipClassDescription = new VirtualRelationshipClassDescription(primaryKeyField, foreignKeyField, RelationshipCardinality.OneToMany);

      using (RelationshipClass relationshipClass = sourceTable.RelateTo(destinationTable, virtualRelationshipClassDescription))
      {
        JoinDescription joinDescription = new JoinDescription(relationshipClass)
        {
          JoinDirection = JoinDirection.Forward,
          JoinType = JoinType.InnerJoin,
          TargetFields = sourceTable.GetDefinition().GetFields()
        };

        using (Join join = new Join(joinDescription))
        {
          Table joinedTable = join.GetJoinedTable();

          //Process the joined table. For example ..
          using (RowCursor cursor = joinedTable.Search())
          {
            while (cursor.MoveNext())
            {
              using (Row row = cursor.Current)
              {
                // Use Row
              }
            }
          }
        }
      }
    }&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 19 Dec 2023 19:31:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/evaluate-a-querydef-with-joined-tables-or/m-p/1362751#M10905</guid>
      <dc:creator>RejeanLabbe</dc:creator>
      <dc:date>2023-12-19T19:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate a QueryDef with joined tables or featureClass from a Feature Layer URL</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/evaluate-a-querydef-with-joined-tables-or/m-p/1566059#M12385</link>
      <description>&lt;P&gt;QueryDef mainQueryDef = new QueryDef&lt;BR /&gt;{&lt;BR /&gt;Tables = $"DD_PLAN_1_STUDENT_COUNT LEFT JOIN ({"SELECT DD_PLAN_1_STA_ENROLLMENT.SCHL_ATND AS SCHOOL, Sum( DD_PLAN_1_STA_ENROLLMENT.TOTAL_ENROLLMENT) AS TOTALENROLL, SUM(DD_PLAN_1_STA_ENROLLMENT.GPK+DD_PLAN_1_STA_ENROLLMENT.GK+DD_PLAN_1_STA_ENROLLMENT.G1+" +&lt;BR /&gt;"DD_PLAN_1_STA_ENROLLMENT.G2+DD_PLAN_1_STA_ENROLLMENT.G3+DD_PLAN_1_STA_ENROLLMENT.G4+DD_PLAN_1_STA_ENROLLMENT.G5+DD_PLAN_1_STA_ENROLLMENT.G6) AS [PK-6], SUM(DD_PLAN_1_STA_ENROLLMENT.GPK) AS GPK, SUM(DD_PLAN_1_STA_ENROLLMENT.GK) AS GK, SUM(DD_PLAN_1_STA_ENROLLMENT.G1) AS G1, SUM(DD_PLAN_1_STA_ENROLLMENT.G2) AS G2, " +&lt;BR /&gt;"SUM(DD_PLAN_1_STA_ENROLLMENT.G3) AS G3, SUM(DD_PLAN_1_STA_ENROLLMENT.G4) AS G4, SUM(DD_PLAN_1_STA_ENROLLMENT.G5) AS G5, SUM(DD_PLAN_1_STA_ENROLLMENT.G6) AS G6, SUM(DD_PLAN_1_STA_ENROLLMENT.G7) AS G7, SUM(DD_PLAN_1_STA_ENROLLMENT.G8) AS G8," +&lt;BR /&gt;" SUM(DD_PLAN_1_STA_ENROLLMENT.G9) AS G9, SUM(DD_PLAN_1_STA_ENROLLMENT.G10) AS G10, SUM(DD_PLAN_1_STA_ENROLLMENT.G11) AS G11, SUM(DD_PLAN_1_STA_ENROLLMENT.G12) AS G12 FROM DD_PLAN_1_STA_ENROLLMENT GROUP BY DD_PLAN_1_STA_ENROLLMENT.SCHL_ATND"}) AS DD_ENROLLMENT ON DD_PLAN_1_STUDENT_COUNT.SCHL_NAME = DD_ENROLLMENT.SCHOOL",&lt;BR /&gt;SubFields = "DD_PLAN_1_STUDENT_COUNT.SCHL_NAME AS SCHOOL, " +&lt;BR /&gt;"DD_PLAN_1_STUDENT_COUNT.GRD_RANGE AS GRADES_SERVED, " +&lt;BR /&gt;"DD_ENROLLMENT.TOTALENROLL + DD_PLAN_1_STUDENT_COUNT.TOTAL AS ENROLLMENT, " +&lt;BR /&gt;"DD_PLAN_1_STUDENT_COUNT.[RS], " +&lt;BR /&gt;"DD_PLAN_1_STUDENT_COUNT.[OD_UM], " +&lt;BR /&gt;"DD_ENROLLMENT.PK6, " +&lt;BR /&gt;"DD_ENROLLMENT.GPK, DD_ENROLLMENT.GK, " +&lt;BR /&gt;"DD_ENROLLMENT.G1, DD_ENROLLMENT.G2, " +&lt;BR /&gt;"DD_ENROLLMENT.G3, DD_ENROLLMENT.G4, DD_ENROLLMENT.G5, " +&lt;BR /&gt;"DD_ENROLLMENT.G6, DD_ENROLLMENT.G7, " +&lt;BR /&gt;"DD_ENROLLMENT.G8, DD_ENROLLMENT.G9, " +&lt;BR /&gt;"DD_ENROLLMENT.G10, DD_ENROLLMENT.G11, DD_ENROLLMENT.G12",&lt;BR /&gt;WhereClause = schoolClause&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;It throws errors: invalid SQL statement. How can I resolve this issue using ArcGIS Pro add-ins in WPF?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Dec 2024 18:41:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/evaluate-a-querydef-with-joined-tables-or/m-p/1566059#M12385</guid>
      <dc:creator>PARTHASARATHIU</dc:creator>
      <dc:date>2024-12-08T18:41:30Z</dc:date>
    </item>
  </channel>
</rss>

