<?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: Spatial Views and Relationships in Geodatabase Questions</title>
    <link>https://community.esri.com/t5/geodatabase-questions/spatial-views-and-relationships/m-p/864911#M5936</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi George,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply. I am on holiday this week, don't have access to the code at work.&lt;/P&gt;&lt;P&gt;The code below is a rough copy of the logic used. The only error that I get from &lt;SPAN&gt;Create Relationship is&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;"the feature is not Registered with the db"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Import system modules &lt;BR /&gt;import arcpy&lt;BR /&gt;from arcpy import env&lt;/P&gt;&lt;P&gt;# Set environment settings&lt;BR /&gt;env.workspace = "D:/users/user"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;## Copy Data&lt;/P&gt;&lt;P&gt;## Copy the Spatial View to Featyre&lt;BR /&gt;database = "TESTDB Connection.sde"&lt;/P&gt;&lt;P&gt;arcpy.CopyFeatures_management("TESTDB.SpTable_JNS_VW", "TESTDB.SpTable_JN_VW")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;##Create Relationship&lt;BR /&gt;SptTbl = "TESTDB.SpTable_JN_VW"&lt;BR /&gt;SptData = "TESTDB.Data_JN"&lt;/P&gt;&lt;P&gt;# Create simple relationship class between SpTable_JN layer&lt;BR /&gt;# and Data_JN table with additional parcel owner information&lt;BR /&gt;SpTable = "SptTbl"&lt;BR /&gt;relClass = "TESTDB.EQUIP_RelClass"&lt;BR /&gt;forLabel = "&lt;SPAN&gt;SpTable&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;EQUIP_ID"&lt;BR /&gt;backLabel = "&lt;SPAN&gt;SptData&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;SW_ID"&lt;BR /&gt;primaryKey = "&lt;SPAN&gt;SpTable&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;EQUIP_ID&lt;/SPAN&gt;"&lt;BR /&gt;foreignKey = "&lt;SPAN&gt;SptData&lt;/SPAN&gt;.SW_ID"&lt;BR /&gt;arcpy.CreateRelationshipClass_management(SpTable,&lt;BR /&gt;SptData,&lt;BR /&gt;relClass,&lt;BR /&gt;"SIMPLE",&lt;BR /&gt;forLabel,&lt;BR /&gt;backLabel,&lt;BR /&gt;"BACKWARD",&lt;BR /&gt;"ONE_TO_MANY",&lt;BR /&gt;"NONE",&lt;BR /&gt;primaryKey,&lt;BR /&gt;foreignKey)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Aug 2018 12:57:24 GMT</pubDate>
    <dc:creator>CliveSwan</dc:creator>
    <dc:date>2018-08-21T12:57:24Z</dc:date>
    <item>
      <title>Spatial Views and Relationships</title>
      <link>https://community.esri.com/t5/geodatabase-questions/spatial-views-and-relationships/m-p/864909#M5934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am working in a Server for ArcGIS 10.3 environment with a Versioned Enterprise Oracle 12.g gdb.&lt;/P&gt;&lt;P&gt;We have a number of spatial tables/queries that are renewed every day. The Spatial tables are created joining several tables. We want to create spatial&amp;nbsp;Views on the Default gdb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I export the required Spatial table/query to a Spatial table they lose the Joined data??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to use ArcPY/Python to export the Joined Spatial Table to a Spatial table (SpTable_JN), then create a relationship with a table (Data_JN). This should be a simple task, yet I keep getting an error that the tables cannot be Registered with the database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone experienced a similar&amp;nbsp;problem and found a solution?? I would appreciate any advice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clive&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2018 10:39:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/spatial-views-and-relationships/m-p/864909#M5934</guid>
      <dc:creator>CliveSwan</dc:creator>
      <dc:date>2018-08-21T10:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Views and Relationships</title>
      <link>https://community.esri.com/t5/geodatabase-questions/spatial-views-and-relationships/m-p/864910#M5935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please post some of the Python that you are using to export the table and create the relationship? This will make troubleshooting easier. Also post a screenshot of the exact error message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/space/2053"&gt;Enterprise GIS&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2018 11:16:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/spatial-views-and-relationships/m-p/864910#M5935</guid>
      <dc:creator>George_Thompson</dc:creator>
      <dc:date>2018-08-21T11:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Views and Relationships</title>
      <link>https://community.esri.com/t5/geodatabase-questions/spatial-views-and-relationships/m-p/864911#M5936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi George,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply. I am on holiday this week, don't have access to the code at work.&lt;/P&gt;&lt;P&gt;The code below is a rough copy of the logic used. The only error that I get from &lt;SPAN&gt;Create Relationship is&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;"the feature is not Registered with the db"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Import system modules &lt;BR /&gt;import arcpy&lt;BR /&gt;from arcpy import env&lt;/P&gt;&lt;P&gt;# Set environment settings&lt;BR /&gt;env.workspace = "D:/users/user"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;## Copy Data&lt;/P&gt;&lt;P&gt;## Copy the Spatial View to Featyre&lt;BR /&gt;database = "TESTDB Connection.sde"&lt;/P&gt;&lt;P&gt;arcpy.CopyFeatures_management("TESTDB.SpTable_JNS_VW", "TESTDB.SpTable_JN_VW")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;##Create Relationship&lt;BR /&gt;SptTbl = "TESTDB.SpTable_JN_VW"&lt;BR /&gt;SptData = "TESTDB.Data_JN"&lt;/P&gt;&lt;P&gt;# Create simple relationship class between SpTable_JN layer&lt;BR /&gt;# and Data_JN table with additional parcel owner information&lt;BR /&gt;SpTable = "SptTbl"&lt;BR /&gt;relClass = "TESTDB.EQUIP_RelClass"&lt;BR /&gt;forLabel = "&lt;SPAN&gt;SpTable&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;EQUIP_ID"&lt;BR /&gt;backLabel = "&lt;SPAN&gt;SptData&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;SW_ID"&lt;BR /&gt;primaryKey = "&lt;SPAN&gt;SpTable&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;EQUIP_ID&lt;/SPAN&gt;"&lt;BR /&gt;foreignKey = "&lt;SPAN&gt;SptData&lt;/SPAN&gt;.SW_ID"&lt;BR /&gt;arcpy.CreateRelationshipClass_management(SpTable,&lt;BR /&gt;SptData,&lt;BR /&gt;relClass,&lt;BR /&gt;"SIMPLE",&lt;BR /&gt;forLabel,&lt;BR /&gt;backLabel,&lt;BR /&gt;"BACKWARD",&lt;BR /&gt;"ONE_TO_MANY",&lt;BR /&gt;"NONE",&lt;BR /&gt;primaryKey,&lt;BR /&gt;foreignKey)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2018 12:57:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/spatial-views-and-relationships/m-p/864911#M5936</guid>
      <dc:creator>CliveSwan</dc:creator>
      <dc:date>2018-08-21T12:57:24Z</dc:date>
    </item>
  </channel>
</rss>

