Select to view content in your preferred language

Geoprocess Automation Help

556
3
07-30-2012 02:37 PM
SamLipscomb
Deactivated User
Hi all,

I was tasked with designing a database at work and have used the model builder to help me create a python script to automate the process. The script basically takes four tables from an Access database, imports them into a geodatabase, geocodes one of the tables, and then relates the other three tables to the geocoding result.  In ArcMap's python and model builder, it runs perfectly.  However, when I try to run the script out of arcmap and in Python, it encounters an error saying that they couldn't create the table because there is already a table in the geodatabase with that name.  Basically, it won't overwrite the files outside of ArcMap. 

My hope is that once this is figured out, I can schedule this script to run daily after work hours. This is the first time I've ever tried something like this, so I'm excited to learn and get this working! Any help would be greatly appreciated!

Also, I'm on the east coast, so I won't be able to try anything about until I get back to work tomorrow.

Thanks,
Sam
Tags (2)
0 Kudos
3 Replies
ChrisSnyder
Honored Contributor
In the script, be sure to add this line of code:

arcpy.env.overwriteOutput = True

Also of course, make sure that you aren't looking at the table to be updated while you are running your script.
0 Kudos
SamLipscomb
Deactivated User
In the script, be sure to add this line of code:

arcpy.env.overwriteOutput = True

Also of course, make sure that you aren't looking at the table to be updated while you are running your script.


Awesome, Thank you! A day full of googling and I could have just come here. Does it matter where I add this in the script?
0 Kudos
ChrisSnyder
Honored Contributor
Sometime after "import arcpy" and sometime before running a tool that overwrites an existing dataset.
0 Kudos