I have a very strange issue: I try to execute the following script which uses TableSelect_analysis and construct as outputs the corresponding tables from another table depending on a specific attribute. For example I have 1000 rows with urban, rural and industrial areas and I want to output 3 files each with the corresponding kind of area.

The code:

for idx, description in enumerate(greeklishDescrList):  
    description = description.replace(" ", "_")  
    outSHP = outDir + description + u".shp"  
    idxOriginal = descrList[idx]  
    arcpy.TableSelect_analysis(r"C:\r*******d\R********l.gdb\l*********I.shp", outSHP, "\"descr\" = '" + idxOriginal + "'")  

What happens is this:

In the first iteration of the for loop it does select all the rows with the correct value "descr".

1st ISSUE:

Output name in the gdb is "shp" when it should have named it as I have coded elsewhere as RURAL.shp . In the contents of "shp" table everything is as expected.

2nd ISSUE:

In the next iteration it breaks down showing the following message:

ExecuteError: ERROR 000210: Cannot create output C:\r*********d\R********l.gdb\URBAN.shp Failed to execute (TableSelect).

Through the Python scripting environment of ArcGIS (I code through PyCharm) it also shows the following



  1. The path is correct. It is clear also from the fact that it constructes the problematic "shp.shp" table with -however- the correct values.
  2. There are permissions available for the same reason as (1)
  3. I have excluded the gdb and the whole directory from my Microsoft Security Essentials
  4. The files do not exist (I believe!). I delete them from the gdb through ArcGIS and I restarted everything multiple times

ArcGIS 10.3.1 with Python 2.7.8


It is not possible to specify shapefiles within a geodatabase and this was causing all of the malfuctions. I have constructed a different folder and assigned the ouputs there and everything is in fine order.

For details and deeper input from @Vince:

You cannot place shapefiles in a file geodatabase. They are different formats. You can convert a shapefile to an FGDB table, but then it is no longer a shapefile -- it is now a table. FGDB tables cannot have a ".shp" suffix, because they cannot have any suffix -- The "." character is not permitted in table names. The files within the .gdb directory can only by managed by the FGDB. Placing other files there makes them invisible to ArcGIS.

and from @ed.hank:

What is the difference between Coverage, Shapefiles and Geodatabases in ArcGIS?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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