Calculate Field Returning Error

4405
2
08-26-2011 08:49 AM
MikeMacRae
Occasional Contributor III
Hello all. I have been having issues with running the Calculate Field tool in python. I have an older script that I used for the first time in a while and it was throwing the following error:

ERROR 999999: Error executing function.
Expected end of statement
Failed to execute (CalculateField).



I created a simple model using only the calculate field, set up a ploygon feature class with a field called "SITE" and exported to python. I ran it again, and the same error came up. I haven't been able to find a solution on the net. Can anyone suggest what I may be missing?

import arcpy
# Local variables:
TESTFC = "Z:\\Figure_Sourcing\\Figures\\Geodatabase\\TESTGDB.gdb\\TESTFC"

# Process: Calculate Field
arcpy.CalculateField_management(TESTFC, "SITE", "D01 Site", "VB", "")
Tags (2)
0 Kudos
2 Replies
DarrenWiens2
MVP Honored Contributor
"To calculate strings to text or character fields, in the dialog box the string must be double-quoted ("string"), or in scripting, the double-quoted string must also be encapsulated in single quotes ('"string"')."

- from CalculateField help
0 Kudos
MikeMacRae
Occasional Contributor III
Thanks once again Darren. This solved my issue.
0 Kudos