AnsweredAssumed Answered

Work with a spatial View in Python

Question asked by ascullyCOT on Mar 14, 2018
Latest reply on Mar 15, 2018 by vangelo-esristaff

Having a difficult time with what should be a simple task - 

In a python script, i'm trying to write records from a view in an SDE database (sqlserver) to either a table or feature class (whichever works - the idea is to write a set of records to an table/FC that serves as an archive, with a date marking the date of the run time for the script)

I've tried CopyRows, Append, ArcSDESQLExecute - all fail, for a variety of reasons - geometry type not supported (Append) or an error relating to being unable to insert NULL values into OBJECTID column - fair enough but my understanding is that because the target table is registered with the database, and would automatically generate an OBJECTID (this is for ArcSDESQLExecute method with an 'Insert' SQL statement).  


My hunch is something is not right with the view (the 'source' data) - but am looking for suggestions/experiences around working with views in Arcpy tools in a python (not desktop ArcGIS) environment.


Thanks -