<?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: Enterprise geodatabase domains from source table are not applied to view in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/enterprise-geodatabase-domains-from-source-table/m-p/1544659#M40659</link>
    <description>&lt;P&gt;It worked very well before!!!&lt;/P&gt;&lt;P&gt;Bug??&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Oct 2024 10:01:06 GMT</pubDate>
    <dc:creator>bledos_cergypontoise</dc:creator>
    <dc:date>2024-10-02T10:01:06Z</dc:date>
    <item>
      <title>Enterprise geodatabase domains from source table are not applied to view</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/enterprise-geodatabase-domains-from-source-table/m-p/1388467#M38790</link>
      <description>&lt;P&gt;Enterprise geodatabase domains from source table are not applied to view.&lt;/P&gt;&lt;P&gt;I apply something like the following query using the 'create database view' tool.&lt;/P&gt;&lt;P&gt;SELECT t2.OBJECTID, t2.SHAPE, t2.attr, t2.type, t1.attr1, t3.attr2, t2.area_ha&lt;BR /&gt;FROM gis_project.sde.table1 t1&lt;BR /&gt;INNER JOIN gis_project.sde.table2 t2 ON t1.table1_id = t2.table1_id&lt;BR /&gt;INNER JOIN gis_project.sde.table3 t3 ON t2.table2_id = t3.table2_id&lt;/P&gt;&lt;P&gt;t2.type contains integers and the domain maps 0 = 'some text' and so on. The source table retains the domain but resulting view shows the integers.&lt;/P&gt;&lt;P&gt;I am going to see if I can create the view or the lookup reference in PgAdmin, but I would prefer to use esri tools.&lt;/P&gt;&lt;P&gt;ArcGIS Pro 3.2.0, PostgreSQL 15, PostGIS 3.4.1&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 00:39:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/enterprise-geodatabase-domains-from-source-table/m-p/1388467#M38790</guid>
      <dc:creator>GreenCollarGroup</dc:creator>
      <dc:date>2024-02-29T00:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: Enterprise geodatabase domains from source table are not applied to view</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/enterprise-geodatabase-domains-from-source-table/m-p/1388509#M38791</link>
      <description>&lt;P&gt;I would still much prefer Esri tools but I have found a work around using PgAdmin.&lt;BR /&gt;&lt;BR /&gt;Process modified from (&lt;A href="https://www.the-art-of-web.com/sql/lookup-table/" target="_blank"&gt;https://www.the-art-of-web.com/sql/lookup-table/&lt;/A&gt;). I manually create a lookup table and set constraints on the original table. Something like this:&lt;/P&gt;&lt;DIV&gt;INSERT INTO lookup_table (name) SELECT DISTINCT type FROM table1;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;UPDATE gisowner.lookup_table&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SET description='string_value1'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;WHERE name='0';&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;UPDATE gisowner.lookup_table&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SET description='string_value2'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;WHERE name!='0';&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;ALTER TABLE table1 ADD COLUMN typeid int;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;UPDATE table1 SET typeid=lookup_table.id FROM lookup_table&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; WHERE table1.type=lookup_table.name;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;ALTER TABLE table1 ALTER typeid SET NOT NULL;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;ALTER TABLE table1 ADD CONSTRAINT "table1_typeid_fkey"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; FOREIGN KEY (typeid) REFERENCES lookup_table(id);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;ALTER TABLE table1 DROP COLUMN type;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;SELECT * FROM gisowner.table1 LIMIT 20;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Once this is done I applied the lookup in the view definition:&lt;BR /&gt;SELECT t2.OBJECTID, t2.SHAPE, t2.attr, t2.type, t1.attr1, t3.attr2, t2.area_ha&lt;BR /&gt;FROM naperville.gisowner.table1 t1&lt;BR /&gt;INNER JOIN naperville.gisowner.table2 t2 ON t1.table1_id = t2.table1_id&lt;BR /&gt;INNER JOIN naperville.gisowner.table3 t3 ON t2.table2_id = t3.table2_id&lt;BR /&gt;JOIN naperville.gisowner.lookup_table lt ON t2.typeid = lt.id&lt;BR /&gt;&lt;BR /&gt;I really hope there is a more straight forward approach using Pro...&lt;/DIV&gt;</description>
      <pubDate>Thu, 29 Feb 2024 02:41:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/enterprise-geodatabase-domains-from-source-table/m-p/1388509#M38791</guid>
      <dc:creator>GreenCollarGroup</dc:creator>
      <dc:date>2024-02-29T02:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Enterprise geodatabase domains from source table are not applied to view</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/enterprise-geodatabase-domains-from-source-table/m-p/1544659#M40659</link>
      <description>&lt;P&gt;It worked very well before!!!&lt;/P&gt;&lt;P&gt;Bug??&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 10:01:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/enterprise-geodatabase-domains-from-source-table/m-p/1544659#M40659</guid>
      <dc:creator>bledos_cergypontoise</dc:creator>
      <dc:date>2024-10-02T10:01:06Z</dc:date>
    </item>
  </channel>
</rss>

