1

So I think I'm running into a data/schema lock issue, but I have no idea how to tell, or how to fix it for that matter. Here's the setup:

I have this chain of gp functions:

#extract elevations to stations
arcpy.gp.ExtractValuesToPoints_sa(station_locations, elevation_raster, scratchGDB + "\station_elevations", "NONE", "VALUE_ONLY")
#calculate the mean air temperature for each station over the n-hour time period
arcpy.Statistics_analysis(data_table, scratchGDB + "\station_statistics", "air_temperature MEAN", "site_key")
#join elevations to the statistics table created above
arcpy.JoinField_management(scratchGDB + "\station_statistics", "site_key", scratchGDB + "\station_elevations", "Site_Key", "RASTERVALU")
#select rows in "station_statistics" that have a positive elevation (non-null)
arcpy.TableSelect_analysis(scratchGDB + "\station_statistics", "stats1", "RASTERVALU IS NOT NULL")

scratchGDB is set from:

scratchGDB = arcpy.env.scratchGDB

When I run these four gp functions one at a time in the ArcMap python window, they run successfully. But when I run the debug in PyScripter on the stand-alone script, I get this error from the "arcpy.TableSelect_analysis" function:

table select error

Looking into "ERROR 000210" is what makes me think it's a data lock issue, but I'd like to know what's making it work in the python window and not work in the PyScripter IDE?

0

1 Answer 1

2

I don't see where you set the env so try changing your Table Select line to:

arcpy.TableSelect_analysis(scratchGDB + "\station_statistics", scratchGDB + "\stats1", "RASTERVALU IS NOT NULL")
2
  • doh! Okay, so it was obvious :) sometimes all it takes is an extra set of eyes...
    – GISUser9
    Nov 4, 2014 at 18:54
  • @GISUser9, I do this ALL the time! Be sure to mark this as the answer so it can help others in the future.
    – evv_gis
    Nov 4, 2014 at 18:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.