AnsweredAssumed Answered

UpdateCursor and Join

Question asked by olivier57 on Jan 20, 2012
Latest reply on Jan 25, 2012 by olivier57

I need to build a function that remove first and last point of lines. Soft works with SearchCursor but get 99999 error as soon as I try to use UpdateCursor. I think it could have a link with the Join but don't understand
Error occurs on UpdateCursor call when placed after join and when getvalue when UpdateCursor placer before Join.

Thanks for any help,

# Process: Make Feature Layer...
gp.MakeFeatureLayer_management(arc_shp, arc_layer, "", "", "ID_ARC ID_ARC VISIBLE NONE")
gp.MakeFeatureLayer_management(pnt_shp, pnt_layer, "", "", "ID_POINT ID_POINT VISIBLE NONE")

#rows_arc = gp.UpdateCursor(arc_layer)  #option 2

# Process: Add Join...
gp.QualifiedFieldNames = "UNQUALIFIED"
gp.AddJoin_management(arc_layer, "ID_ARC", tab_line, "ID_ARC", "KEEP_ALL")
gp.AddJoin_management(pnt_layer, "ID_POINT", tab_point, "ID_POINT", "KEEP_ALL")

rows_arc = gp.UpdateCursor(arc_layer) #option 1
desc_arc = gp.describe(arc_layer)
row_arc = rows_arc.Next()

while row_arc:
feat_arc=row_arc.getvalue(desc_arc.ShapeFieldName) # Get feature geometry

So When I set option 1, UpdateCursor after join I get the error on the update call

    rows_arc = gp.UpdateCursor(arc_layer)
RuntimeError: ERROR 999999: Error executing function.

When I set option 1, Option 2 : UpdateCursor before join, I get the error at this line


RuntimeError: ERROR 999999: Error executing function.

(I listed field names after join,  they are all there and I tried directly to set "arc.Shape" but it did'nt work.