Hello everyone,
I am running the Python code below first pointing to an SDE layer and then pointing to a FGDB layer and in the first case after the program finish nothing gets inserted in SDE. It works in the FGDB.
The layer in SDE is not versioned.
I can Append layers from the FGDB to SDE using: arcpy.Append_management(
What am I missing?
curAppend = arcpy.InsertCursor(WASDAGREEMENT_D) ..... rowAppend = curAppend.newRow() rowAppend.SHAPE = rowYesterday.SHAPE rowAppend.AGMID = rowYesterday.getValue("AGMID") rowAppend.DIGIBY = rowYesterday.getValue("DIGIBY") rowAppend.DIGIDATE = rowYesterday.getValue("DIGIDATE") rowAppend.STATUS = rowYesterday.getValue("STATUS") rowAppend.REQUESTED = rowYesterday.getValue("REQUESTED") rowAppend.PNAME = rowYesterday.getValue("PNAME") rowAppend.PLOCATION = rowYesterday.getValue("PLOCATION") rowAppend.PDESC = rowYesterday.getValue("PDESC") curAppend.insertRow(rowAppend)
Are you using a del statement for your curAppend? If your not your changes won't show until you close your python IDE
Wes, for some reason I am getting an error on you link. Might want to check it.
Thanks must be something wrong with the links again.
copy and paste in your browser this path without the quotes
"http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-data-access/insertcursor-class.htm"
This same code works fine when I point to a layer in a FGDB but it does nthing when I point to the same king of layer in SDE.
True, because most likely you will need to set up the edit session in your Python script. Did you try this?
You probably have to start an edit session as explained in code sample 2 at the end of this page: Editor—Help | ArcGIS for Desktop