Skip to main content

Hi all,

I would like to: list feature classes/layers from a file geodatabase. Sort. Keep first N tables and drop the rest.

 

All is good till dropping the tables . So my question is how to drop a list of tables in a File Geodatabase

 

I looked at SQLExecutor and there is no option for Esri File geodatase.

In the geodatabase writers you can only "Drop and Create" tables.

This example seems promissing, except I would need to update the User Private Parameter with an sql of tables to drop, and it does not seem to be working in that direction : workspace variable => Published Private Parameter. Or does it?

https://gis.stackexchange.com/questions/251542/how-to-delete-a-single-feature-class-from-a-geodatabase-using-fme

 

Just to mention that in this example, if I hardcode the Published Private parameter with list of tables to drop it works

"FME_SQL_DELIMITER ; DROP TABLE first_table; DROP TABLE second_table;"

 

 

All suggestion are welcome and thanks in advance

I would look into using the PythonCaller using the arcpy.Delete_management command

 

Delete (Data Management)—ArcMap | Documentation (arcgis.com)

 


A flow of transformers similar to this should get you started

 

imageInside the featurereader parameters section, you'll see the sql to run after write. might need to play with the sql a bit, but it would look something like this. it uses the attribute value to reference the tables needing to be deleted.

image--

If i've provided something helpful, please upvote the comment. If i've provided a solution, please mark it as 'Best Answer'. This helps the community find solutions when your question is referenced.

If I didn't provide a solution, please let me know if I can help further. Thanks! 🙂


Thank you carmijo. It worked!


Reply