Table to Table Function in Python

525
2
04-08-2011 05:52 AM
StevenRehbaum
New Contributor
I am going to run a weekly script that updates POIs for some Garmin units my group has.  My output is a .dbf that will be converted to .csv and then loaded.  My final operation of the model/script is Table to Table.  I need to have this .dbf overwritten each instance it is run.  My geoprocessing overwrite function is turned on and runs fine in ModelBuilder, but it will not overwrite the .dbf from the script and gives me the Error 000258 stating the table already exists.  I wasn't sure if I was missing something or there is some snippet of code which will allow the .dbf to be forcibly overwritten.  I know I could just write the first part of the model/script to delete the existing one before it runs again, but I was hoping not to do so.  Any help is greatly appreciated. 

arcpy.TableToTable_conversion
Tags (2)
0 Kudos
2 Replies
ZoeZaloudek
Occasional Contributor
I usually set the OverWriteOutput to 1 at the beginning of my scripts.  I'm using 9.3, so I'm not sure how this translates over to 10 & arcpy...  But it's probably similar.

# Import system modules
import sys, string, os, arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

# Set the Geoprocessing environment...
gp.OverWriteOutput = 1 #Overwrite set to true
0 Kudos
StevenRehbaum
New Contributor
I usually set the OverWriteOutput to 1 at the beginning of my scripts.  I'm using 9.3, so I'm not sure how this translates over to 10 & arcpy...  But it's probably similar.

# Import system modules
import sys, string, os, arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

# Set the Geoprocessing environment...
gp.OverWriteOutput = 1 #Overwrite set to true


I knew it was something like that! 🙂  Worked perfectly.  Many thanks.
0 Kudos