Skip to main content
Solved

Drop a feature class/layers from esri file geodatabase

  • September 28, 2022
  • 3 replies
  • 220 views

john_galt
Contributor
Forum|alt.badge.img

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

Best answer by carmijo

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! 🙂

View original
Did this help you find an answer to your question?

3 replies

dustin
Influencer
Forum|alt.badge.img+30
  • Influencer
  • September 28, 2022

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

 

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

 


carmijo
Supporter
Forum|alt.badge.img+11
  • Supporter
  • Best Answer
  • September 28, 2022

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! 🙂


john_galt
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • September 28, 2022

Thank you carmijo. It worked!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings