SDE Views in ArcGIS 10.4 and OBJECTID field

683
1
11-07-2017 06:23 AM
Highlighted
Occasional Contributor III

Hello everyone,

When creating an SDE View in ArcSDE 10.4 between a FC and a table. How is the field OBJECTID used?

  1. ignore it and create the SDE view without it. This solution does not work well
  2. add the OBJECTID from the FC
  3. add the OBJECTID from the table

The OBJECTID field in a SDE View is a long integer not an OBJECT ID type. So when I copy the SDE view to another Geodatabase it adds a new field OBJECTID_1 in the new feature class, this one has data type Object ID.

Environment:

  • ArcSDE 10.2 Oracle
  • ArcSDE 10.4 SQL

Until ArcGIS 10.2 we created SDE Spatial views with the command line, and they worked fine:

sdetable -o create_view -T ProjectInfo -t "Project, Project_Table" 
-c "Project.SHAPE, Project.OBJECTID, Project.ProjectID, Project_Table.DATEOFFERED, Project_Table.DATEEXECUTED, Project_Table.Project_STATUS,Project_Table.PROJECTNAME" 
-a "SHAPE, OBJECTID, ProjectID, DateOFFERED, DateEXECUTED,STATUS, PROJECTNAME"  -w "Project.ProjectID IS NOT NULL AND  Project.ProjectID = Project_Table.ProjectID"   

Now in ArcGIS 10.4 we are creating SDE Spatial Views directly in ArcCatalog and the OBJECTID field has some issues

 

CREATE VIEW ProjectInfo  AS  SELECT  Project_Table.OBJECTID, Project.SHAPE, Project.ProjectID, Project_Table.ProjectSTATUS AS STATUS ,Project_Table.DATEOFFERED, Project_Table.DATEEXECUTED, Project_Table.PROJECTNAME   FROM Project INNER JOIN Project_Table ON  Project.ProjectID = Project_Table.ProjectID WHERE (NOT (Project.ProjectID IS NULL))

Thanks

Reply
0 Kudos
1 Reply
Highlighted
Occasional Contributor II

What does not work when you do not choose an object id?  

There is no need to select the objectid, but keep in mind ArcMap uses a unique, not null field to sort, identify, select and display the data properly.  

For example, using the counties feature class in the ArcDesktop template data folder (C:\Program Files (x86)\ArcGIS\Desktop10.<your version>\TemplateData), I create a new test view.

select NAME from counties;‍‍

Adding this view to ArcMap I am prompted to choose my unique column.  The only column I have to choose from is NAME.  The query layer is then added with only unique name values.  Therefore, the query layer in ArcMap will filter out all duplicate name values.

Reply
0 Kudos