AnsweredAssumed Answered

Receiving runtime error start edit session

Question asked by mpcalvo on Oct 31, 2013
Latest reply on Oct 31, 2013 by mpcalvo
Not sure why this is throwing an error.

    ## Get un-processed features from XYAttachments_insp     GUID_Lst = [row[0] for row in arcpy.da.SearchCursor(JU_Src,Srch_Fld)]     UGuid = set(GUID_Lst)     print UGuid     edit = arcpy.da.Editor(Wrksp)      for GUID in UGuid:         edit.startOperation()         edit.startEditing(True,True)         GSel = "GOSYNC.DBO.Att_Join_Tmp.wm_ElementGUID = GOSYNC.DBO.XYAttachments_insp.wm_ElementGUID AND GOSYNC.DBO.XYAttachments_insp.wm_ElementGUID =" + "'"+str(GUID)+"'"         arcpy.MakeQueryTable_management("'Database Connections\\GOSYNC_GOSYNC.sde\\GOSYNC.DBO.Joint_Use_Insp\\GOSYNC.DBO.Att_Join_Tmp';\         'Database Connections\\GOSYNC_GOSYNC.sde\\GOSYNC.DBO.Joint_Use_Insp\\GOSYNC.DBO.XYAttachments_insp'", "QryCnt", "USE_KEY_FIELDS",\          "GOSYNC.DBO.Att_Join_Tmp.OBJECTID", "GOSYNC.DBO.XYAttachments_insp.wm_ElementGUID #; GOSYNC.DBO.Att_Join_Tmp.wm_ElementGUID #;GOSYNC.DBO.Att_Join_Tmp.Attachment_ID #",\          GSel)         IDCnt = int(arcpy.GetCount_management("QryCnt").getOutput(0)) + 1         print IDCnt         WH_Clause = "\"wm_ElementGUID\" = '"+ GUID+"'"         with arcpy.da.UpdateCursor(JU_Src,[Upd_Fld],WH_Clause) as UpdCrsr:             for Urow in UpdCrsr:                 ATT_ID = str(GUID) + "_A"+str(IDCnt)                 print ATT_ID                 print Urow                 Urow[0] = ATT_ID                 UpdCrsr.updateRow(Urow)                 IDCnt = IDCnt + 1             edit.stopOperation()             edit.stopEditing(True)         arcpy.Delete_management("QryCnt")


Any help would be appreciated.

Outcomes