AnsweredAssumed Answered

Error on updateRow or deleteRow

Question asked by sclark98 on Apr 14, 2016
Latest reply on Apr 15, 2016 by sclark98

I have relatedtable in sde that I want to insert or update/delete a row. I am able to insertRow fine but I am not able to execute updateRow or deleteRow on the cursor. There is always: SystemError: error return without exception set

 

Here's the pertinent part of the code:

 

tableFields = ['LID', 'OperatedBy', 'GPSPositions', 'Turns', 'OperationDate', 'Longitude', 'Latitude', 'HighTorque', 'BeginTime', 'Remarks', 'Position', 'EndTime']
insValues = [u'W.285489', u'Roy P.', None, 88.2, datetime.datetime(2015, 2, 19, 0, 0), None, None, 50, u'11:55 AM', u'PAVD,VAC', u'Open', u'12:00 PM']
if tableCount == 0: # Insert - THIS WORKS FINE
    editor.startOperation() 
    with arcpy.da.InsertCursor(tablePath, tableFields) as insCursor:
        insCursor.insertRow(insValues)
    editor.stopOperation()
    saveEdits = True
else: # Update
    editor.startOperation() 
    with arcpy.da.UpdateCursor(tablePath, tableFields, lidQuery) as updCursor:
        for updRow in updCursor: # ALWAYS RETURNS THE ONE ROW THAT I WANTED TO UPDATE OR DELETE
            updRow = insValues
            updCursor.updateRow(updRow) # - ERROR
            # ALSO JUST UPDATING ONE VALUE - SAME ERROR
            # updRow[0] = 'W.999999'
            # updCursor.updateRow(updRow)
    # OR I could deleteRow and then do an insertRow - SAME ERROR
    #    for updRow in updCursor:
    #        updCursor.deleteRow()
    editor.stopOperation() 
    saveEdits = True

 

As far as I can tell, the updCursor returns what I want - the row that I want to update or delete. But no matter what I do with that cursor, I get

 

Traceback (most recent call last):
  File "<pyshell#89>", line 1, in <module>
    updCursor.deleteRow()
SystemError: error return without exception set

or simply "error return without exception set"

 

What am I doing wrong with the UpdateCursor?

 

(This is ArcMap 10.2.1.)

Outcomes