<?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: Why is a spatial view returning empty or null records when field has a domain? in Geodatabase Questions</title>
    <link>https://community.esri.com/t5/geodatabase-questions/why-is-a-spatial-view-returning-empty-or-null/m-p/807221#M2980</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The queries in my original question are actually correct and were returning the correct results as the MAINT_ACTIVITY field in the base table was actually all NULL records.&amp;nbsp; Since the table was registered as versioned, the records I wanted to query were in the&amp;nbsp;&lt;EM&gt;Views&amp;nbsp;&lt;/EM&gt;folder of SSMS.&amp;nbsp; So the following query returned the results that I have been looking for via a spatial view:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;SELECT h.OBJECTID, h.FACILITYID, h.SHAPE, r.Hydrant_ID, r.MAINT_ACTIVITY, r.MaintDate, r.GlobalID&lt;BR /&gt;FROM wHydrant h&lt;BR /&gt;&lt;STRONG&gt;JOIN wHydrant_Maint_evw r&lt;/STRONG&gt;&lt;BR /&gt;ON h.FACILITYID = r.Hydrant_ID&lt;BR /&gt;WHERE (r.MaintDate &amp;gt;= '2014' AND r.MaintDate &amp;lt;= '2015') AND r.MAINT_ACTIVITY = 'Flushed'&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Thank you George &amp;amp; Asrujit for guiding me to the base &amp;amp; view tables in SSMS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Apr 2019 15:16:55 GMT</pubDate>
    <dc:creator>JacobLozano</dc:creator>
    <dc:date>2019-04-09T15:16:55Z</dc:date>
    <item>
      <title>Why is a spatial view returning empty or null records when field has a domain?</title>
      <link>https://community.esri.com/t5/geodatabase-questions/why-is-a-spatial-view-returning-empty-or-null/m-p/807216#M2975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm attempting to create a spatial view between a feature class (wHydrant) and a related table (wHydrant_Maint).&amp;nbsp; I can successfully create views by querying every field in the Hydrant_Maint table, except one (Maint_Activity).&amp;nbsp; The only difference from the other fields is that this Maint_Activity field has a domain.&amp;nbsp; Any attempt to create a view with a WHERE clause on this field will return an empty view with no records returned.&amp;nbsp; When querying other fields, but including this field in the selection, all the results in this field return as null, even though there are in fact entries.&amp;nbsp; Here is my SQL statement that returns all NULL records in the Maint_Activity field:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;SELECT h.OBJECTID, h.FACILITYID, h.SHAPE, r.Hydrant_ID, r.MAINT_ACTIVITY, r.MaintDate, r.GlobalID&lt;/P&gt;&lt;P&gt;FROM wHydrant h&lt;/P&gt;&lt;P&gt;JOIN wHydrant_Maint r&lt;/P&gt;&lt;P&gt;ON h.FACILITYID = r.Hydrant_ID&lt;/P&gt;&lt;P&gt;WHERE r.MaintDate &amp;gt;= '2014' AND r.MaintDate &amp;lt;= '2015'&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following returns an empty table view:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;SELECT h.OBJECTID, h.FACILITYID, h.SHAPE, r.Hydrant_ID, r.MAINT_ACTIVITY, r.MaintDate, r.GlobalID&lt;BR /&gt;FROM wHydrant h&lt;BR /&gt;JOIN wHydrant_Maint r&lt;BR /&gt;ON h.FACILITYID = r.Hydrant_ID&lt;BR /&gt;WHERE r.MAINT_ACTIVITY = 'Flushed'&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Do I need to adjust my syntax to account for a domained field?&amp;nbsp; Also, the code and description for the domain match, in case you're thinking I should query the code for&amp;nbsp;&lt;EM&gt;'Flushed'.&lt;/EM&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Apr 2019 18:32:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/why-is-a-spatial-view-returning-empty-or-null/m-p/807216#M2975</guid>
      <dc:creator>JacobLozano</dc:creator>
      <dc:date>2019-04-08T18:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: Why is a spatial view returning empty or null records when field has a domain?</title>
      <link>https://community.esri.com/t5/geodatabase-questions/why-is-a-spatial-view-returning-empty-or-null/m-p/807217#M2976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure that you can add domains&amp;nbsp;(as you see them in a client) to the spatial view as they are specific to advanced geodatabase functionality;&amp;nbsp;&lt;A href="https://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/registering-a-table-with-the-geodatabase.htm"&gt;https://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/registering-a-table-with-the-geodatabase.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may be able to do it if you specify the domain value(i.e. - 0,1,2,3,4,5, etc.) that is stored in the GDB base table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Apr 2019 22:19:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/why-is-a-spatial-view-returning-empty-or-null/m-p/807217#M2976</guid>
      <dc:creator>George_Thompson</dc:creator>
      <dc:date>2019-04-08T22:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: Why is a spatial view returning empty or null records when field has a domain?</title>
      <link>https://community.esri.com/t5/geodatabase-questions/why-is-a-spatial-view-returning-empty-or-null/m-p/807218#M2977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is the data Versioned? Maybe you need to perform a Compress, to push edits from the a- &amp;amp; d- Tables into the Business Table (base Table).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or, create the Spatial View based on the Versioned View of that feature class.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2019 06:45:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/why-is-a-spatial-view-returning-empty-or-null/m-p/807218#M2977</guid>
      <dc:creator>Asrujit_SenGupta</dc:creator>
      <dc:date>2019-04-09T06:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Why is a spatial view returning empty or null records when field has a domain?</title>
      <link>https://community.esri.com/t5/geodatabase-questions/why-is-a-spatial-view-returning-empty-or-null/m-p/807219#M2978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The code value and the description are the same for this domain.&amp;nbsp; We did not use numeric codes in this instance.&amp;nbsp; However, I went into SSMS to view the wHydrant_Maint table records and all of the MAINT_ACTIVITY records are NULL.&amp;nbsp; Yet when the table is viewed in Arc I see all the entries.&amp;nbsp; So if SQL doesn't see the entries, how am I supposed to query them in SQL?&amp;nbsp; Also, I noticed that all the fields with domains are NULL when viewed in SSMS, BUT there is also a "NOTES" field, a text field with no domain, that is also all NULL in SQL.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2019 14:46:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/why-is-a-spatial-view-returning-empty-or-null/m-p/807219#M2978</guid>
      <dc:creator>JacobLozano</dc:creator>
      <dc:date>2019-04-09T14:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Why is a spatial view returning empty or null records when field has a domain?</title>
      <link>https://community.esri.com/t5/geodatabase-questions/why-is-a-spatial-view-returning-empty-or-null/m-p/807220#M2979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The data is registered as versioned.&amp;nbsp; When I view the &lt;EM&gt;System View&lt;/EM&gt; table in SQL I can now see my entries, whereas all entries are NULL when I view the base table.&amp;nbsp; I will test querying this table and report back my results.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2019 14:55:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/why-is-a-spatial-view-returning-empty-or-null/m-p/807220#M2979</guid>
      <dc:creator>JacobLozano</dc:creator>
      <dc:date>2019-04-09T14:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: Why is a spatial view returning empty or null records when field has a domain?</title>
      <link>https://community.esri.com/t5/geodatabase-questions/why-is-a-spatial-view-returning-empty-or-null/m-p/807221#M2980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The queries in my original question are actually correct and were returning the correct results as the MAINT_ACTIVITY field in the base table was actually all NULL records.&amp;nbsp; Since the table was registered as versioned, the records I wanted to query were in the&amp;nbsp;&lt;EM&gt;Views&amp;nbsp;&lt;/EM&gt;folder of SSMS.&amp;nbsp; So the following query returned the results that I have been looking for via a spatial view:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;SELECT h.OBJECTID, h.FACILITYID, h.SHAPE, r.Hydrant_ID, r.MAINT_ACTIVITY, r.MaintDate, r.GlobalID&lt;BR /&gt;FROM wHydrant h&lt;BR /&gt;&lt;STRONG&gt;JOIN wHydrant_Maint_evw r&lt;/STRONG&gt;&lt;BR /&gt;ON h.FACILITYID = r.Hydrant_ID&lt;BR /&gt;WHERE (r.MaintDate &amp;gt;= '2014' AND r.MaintDate &amp;lt;= '2015') AND r.MAINT_ACTIVITY = 'Flushed'&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Thank you George &amp;amp; Asrujit for guiding me to the base &amp;amp; view tables in SSMS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2019 15:16:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/why-is-a-spatial-view-returning-empty-or-null/m-p/807221#M2980</guid>
      <dc:creator>JacobLozano</dc:creator>
      <dc:date>2019-04-09T15:16:55Z</dc:date>
    </item>
  </channel>
</rss>

