Which Calculate Field expression_type should be used?

2880
2
Jump to solution
03-27-2013 09:46 AM
curtvprice
MVP Esteemed Contributor
I discovered today that VB syntax is not working in the x64 processor when I run Calculate Field. I get this error

Executing: CalculateField lyr XXVAL 1 VB #
Failed to execute. Parameters are not valid.
ERROR 000989: Tool CalculateField cannot use VB expressions for service

So, it looks like if I want my tools to run in x64 arcpy, I must avoid the default VB parser.

Does anyone know which is better to use: the "PYTHON" or "PYTHON_9.3" parser? I'm wondering if there is any performance or compatibility benefit for using "PYTHON" if you don't need to access shape properties. I would think PYTHON_9.3 would be more efficient as it returns objects instead of string representations.

I'm hoping someone on the geoprocessing team can give us advice so we can write CalculateValue expressions in a way that will be the most efficient and forward-compatible...
0 Kudos
1 Solution

Accepted Solutions
DaleHoneycutt
Occasional Contributor III
Curtis:
PYTHON_9.3 is the way to go.  The "9.3" python processor returns lists instead of enumerators, and numerous other benefits over the 9.2 processor (I'll ask around and see if I can get a list of these 'other' benefits, but we are going to have to step into the way-back machine and rummage around thru the muck).  I don't have any performance numbers, but the 9.3 parser will be faster.  Personally, I wish that the PYTHON_9.3 was the default parser for Calculate Field and Calculate Value, but deeply knotted technical issues prevented us from doing that at 10.0 (I think it might be possible now).

View solution in original post

2 Replies
DaleHoneycutt
Occasional Contributor III
Curtis:
PYTHON_9.3 is the way to go.  The "9.3" python processor returns lists instead of enumerators, and numerous other benefits over the 9.2 processor (I'll ask around and see if I can get a list of these 'other' benefits, but we are going to have to step into the way-back machine and rummage around thru the muck).  I don't have any performance numbers, but the 9.3 parser will be faster.  Personally, I wish that the PYTHON_9.3 was the default parser for Calculate Field and Calculate Value, but deeply knotted technical issues prevented us from doing that at 10.0 (I think it might be possible now).
curtvprice
MVP Esteemed Contributor
Thanks, Dale -- appreciate the guidance.

If you do plan to change the default, please recommend that the online help for Calculate Field starts to warn us now! 🙂
0 Kudos