Select to view content in your preferred language

Want to rename or copy a field

2108
3
12-13-2010 09:37 AM
PeteLarson
Emerging Contributor
Hello,

I'm not sure whether this is the right place to put this.

I am using the NEAR tool. It puts the distances in NEAR_DIST. What I would like to do, is to rename NEAR_DIST to something more descriptive like DIST_TO_STORE. I have tried creating a new field DIST_TO_STORE. Then I tried copying the contents of NEAR_DIST to DIST_TO_STORE, but it does not work.

Here is my code:

arcpy.AddField_management("Data2007WithDist", "DIST_TO_STORE", "LONG", 9, "", "", "refcode", "NULLABLE", "REQUIRED")
arcpy.CalculateField_management("Data2007WithDist", "DIST_TO_STORE", '!NEAR_DIST!', "PYTHON")

What am I doing wrong? I just get an error:

WARNING 000405: No records within table

HELP!!!

Pete
0 Kudos
3 Replies
PeteLarson
Emerging Contributor
Problem solved.

The tools do not work when the attribute table is open.

Pete
0 Kudos
Raphael_Augusto_FoscariniFerre
Regular Contributor
Problem solved.

The tools do not work when the attribute table is open.

Pete


actually, i still get this error... even with attribute table closed...

anything else that you changed??


**EDIT: Service Pack3 solved my problem.... Even in toolbox, the 'field calculator' wasnt working... Now it works perfectly...
And now i notice that, if the 'attribute table' is open, the results of the calculation doesnt show untill you refresh it...
0 Kudos
SarahRose2
New Contributor
I'm having the same problem when trying to run the Calculate Field tool with any of my shapefiles.  It doesn't matter whether or not the attribute tables are open or closed, it still gives me that same warning.  I just recently installed Service Pack 3 and wasn't having this issue at all until SP 3.  Any one else having this issue all of a sudden or have any suggestions as to fix this issue?  Is there a way to uninstall SP 3 and go back to SP 2, maybe?
0 Kudos