1

I am trying to produce an FME script that is a replication of an existing python script in order to compare "apples to apples". The point of this project is to prove that FME can process "big data" faster than traditional methods.

Anyways, in order for me to try to accomplish this, I must 1. Not use Python in my FME script and 2. Try to match the logic in the original script verbatim (including unnecessary steps).

My question is then: How can I delete a single feature class from a geodatabase using FME? I understand that the recommended way is to use Python, but since this is not an option for me, and there is no transformer for deleting a single feature class, and there is no way that I can see to do it within a writer, then how can this be accomplished?

  • What sort of geodatabase is it? File, Personal, or Enterprise? – Mark Ireland Aug 9 '17 at 17:23
  • @MarkIreland It is a File GDB – Stella Aug 9 '17 at 17:45
  • Pity. If you were using an enterprise geodatabase then the SQLExecutor could have been used to drop the table (though it's always a risk because it won't take care of any other relationships that exist in the database). File GDB is going to be harder. Ideally it would be a Python command using the PythonCaller transformer. But I am investigating other possibilities. – Mark Ireland Aug 9 '17 at 18:21
  • This sounds to me like a temporary feature class that is created to make another process easier that is subsequently removed. If this is the case surely a bit of latitude on where the temporary 'working' dataset is held would be acceptable. – MickyT Aug 10 '17 at 1:57
  • 2
    To be honest this type of comparison is not really reasonable and your results may not be optimum. It would be like saying build a crate using a screw driver and screws instead of a hammer and nails, but you have to hammer in the screws with the screwdriver. The comparison should be "can you reproduce the same end result from FME without just running the python script from within it". – MickyT Aug 10 '17 at 1:58
6

Initially, I hadn't read the question properly, and answered with a python solution. However, I see now that you can't use python, so I have a different solution for you. It requires that you use the ArcObjects File Geodatabase Writer which I believe is only available if you have ArcGIS installed on the same computer as FME.

The trick is to take advantage of an option in the Advanced Writer Parameters called "SQL To Run After Write". Because File Geodatabases support SQL92, you should be able to run most SQL queries with that. The query you need is:

DROP TABLE "Feature Class Name"

enter image description here

In the below example, I have a file geodatabase with two point feature classes.

enter image description here

My writer is writing to FeatureClass2.

enter image description here

However, with the SQL Query running after the writer finishes, it drops FeatureClass1.

enter image description here

I tried to run this command with multiple tables but didn't have any luck.

Here's some documentation on SQL92.

  • @MarkIreland, thanks. You triggered my memory with your comment about the SQLExecutor. I've never actually used that function before, but I'm going to now. Maybe you can talk to the Safe devs about why I can't drop multiple tables in one command. Maybe it's a syntax thing. I just comma separated table names. It would also be good to get a list of table names and store them as an attribute to pass into the SQL query field. Maybe use a workspace runner and pass it as a parameter... – Fezter Aug 10 '17 at 23:10
  • Our work will enforce you move that table data to a staging table first (this for for rollback if needed). – Mapperz Aug 11 '17 at 0:43

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.