Skip to main content
Solved

Drop a feature class/layers from esri file geodatabase

  • September 28, 2022
  • 3 replies
  • 305 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! 🙂

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

dustin
Influencer
Forum|alt.badge.img+31
  • 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!