ListTables does not work...

968
5
Jump to solution
08-20-2013 05:13 AM
TomGeo
by
Occasional Contributor III
Hi,

I am working with ArcGIS 10.1 SP1 and I try to list tables from within a file geodatabase.
I set the workspace to the specific geodatabase and write:

lstTables = arcpy.ListTables() len(lstTables)


The result of this is an empty list. I can reproduce this using external scripts, and when using the Python window within ArcMap or ArcCatalog. I can see all the tables in ArcCatalog and I can have a preview of them... However, to list them is impossible.
it is also impossible to copy them into another FGDB. The attempt to copy the tables ends in crashing ArcMap or ArcCatalog.

When I try to list all the feature classes in the same FGDB then I have no problem and I get the correct result.

Any solution for this problem?

Bests Tom
- We are living in the 21st century.
GIS moved on and nobody needs a format consisting out of at least three files! No, nobody needs shapefiles, not even for the sake of an exchange format. Folks, use GeoPackage to exchange data with other GIS!
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JakeSkinner
Esri Esteemed Contributor
Try using the Recover File Geodatabase tool, and then see if you can run the arcpy.ListTables function on the recovered FGD.

View solution in original post

0 Kudos
5 Replies
markdenil
Occasional Contributor III
Ghost tables? Spooky.

Can you load them into ArcMap? ... and potentailly save as from there?
Can you find their properties with arcpy.describe()?
What does arcpy.Exist() say?

Have you tried accessing them from a stand-alone python script (not in a python window)?
0 Kudos
TomGeo
by
Occasional Contributor III
Hi Mark,


  • yes, I can load them into ArcMap and also open them.

  • yes, I can access their properties using arcpy.Describe()


  • t1 = "path/to/fgdb/and/table"
    desc = arcpy.Describe(t1)
    print desc.DataType


    results in u'Table'

  • arcpy.Exists(t1) comes back with True

  • yes, I also did try to access them from a stand-alone script

  • I also did try to get the tables via arcpy.da.Walk, but there was nothing to append to a previous created list.


Tom
- We are living in the 21st century.
GIS moved on and nobody needs a format consisting out of at least three files! No, nobody needs shapefiles, not even for the sake of an exchange format. Folks, use GeoPackage to exchange data with other GIS!
0 Kudos
JakeSkinner
Esri Esteemed Contributor
Try using the Recover File Geodatabase tool, and then see if you can run the arcpy.ListTables function on the recovered FGD.
0 Kudos
TomGeo
by
Occasional Contributor III
Thanks Jake,

that worked. Does the company know why that can happen? Will ArcGIS 10.2 overcome the problem?

Cheers Tom
- We are living in the 21st century.
GIS moved on and nobody needs a format consisting out of at least three files! No, nobody needs shapefiles, not even for the sake of an exchange format. Folks, use GeoPackage to exchange data with other GIS!
0 Kudos
RhettZufelt
MVP Frequent Contributor
Tom,

Most common cause of something like this is when someone deletes one or more files from the FGDB using windows (not ArcCatalog).

R_
0 Kudos