I am trying to populate a field with a value from another field in the same row, the condition I have set for this to take place is if a third field is equal to 0. In order to achieve this I have written a python script utilizing an 'if' statement and the getValue and setValue functions. I haven't used these functions before and I am having difficulty getting them to work properly. I tried various different lines of syntax but keep getting the same error:
Runtime error : ERROR 999999: Error executing function.
This has left me a little baffled as I am not sure where the problem lies. Anyway, here's the script:
import arcpy
joinFC = "C:\MyArcGIS\Link_tool\Join22.shp"
rows = arcpy.UpdateCursor(joinFC)
for row in rows:
if row.getValue("Input") == 0:
edrn_value = row.getValue("LCC_DRN_3")
row.setValue("DRN_input", edrn_value)
rows.updateRow(row)
del row, rows
In case it is not obvious I am using ArcGIS 10.0. The field types for the three fields are:
LCC_DRN_3 = String
Input = Long
DRN_input = String
Does anyone have any idea why this script is not working?