I'm getting this:
Runtime error
Traceback (most recent call last):
File "<string>", line 3, in <module>
RuntimeError: Objects in this class cannot be updated outside an edit session [GDB_AGR_SECURE.AGR_ADMIN.ApiariesWGS_20160927]
When I run this:
I'm trying to update the point locations based on attributes.
Thanks in advance.
JG
Solved! Go to Solution.
Does it look something like this?
filepath = r'path to the .sde'
arcpy.env.workspace = filepath
edit = arcpy.da.Editor(filepath)
Have you tried setting the env workspace? Current Workspace (Environment setting)—Help | ArcGIS for Desktop
Right now, your 'workspace' is just a variable. It's not setting the arcpy.env.workspace. Also, that workspace is pointing to 'C:\Users\joanna.grossman\AppDate\Roaming\ESRI\Desktop10.4\ArcCatalog'... which I'm pretty sure isn't correct.
I'm doing that i lines 5-7. =(
hmmm. Seems consistent with examples I've seen, but I'll take a look. Thx.
ok, so I added arcpy.env.workspace = filepath, just for the heck of it and got the same error. Also, just FYI, that connection path is correct...Thanks, tho.
Does it look something like this?
filepath = r'path to the .sde'
arcpy.env.workspace = filepath
edit = arcpy.da.Editor(filepath)
aha. It didn't exactly, but I switched to your template and it stopped doing the edit sesh error. It moved onto "RuntimeError: The version of your database server is not supported." So, now I have another fish to fry. Thanks for your help!
Try changing line 10 to:
edit = arcpy.da.Editor(filepath)
Line 07 is unnecessary. Furthermore, you need to pass the full path to the workspace, which is an SDE connection file in this case, and not the directory that contains the workspace.
yep, just got there. Thank you!