Skip to main content
I need to write records to 3 different databases and then delete the source records from the source database. What is the best way of making sure the records are not deleted from the source before all the writes have completed?

I would use FeatureWriters to write the target records, then check the Summary ports to verify that the correct number of records was written. If yes, I'd use an SQLExecutor to delete the source record(s).


I'm guessing you are using the database writers, the order of your writers in your table of contents is the order the operations will happen. So, if your delete writer is at the top it will delete first and then write. Right click on it and move down if it's higher than the writers.

 

You are probably better off using the FeatureWriters as @david_r​ says. Also, for now, write records you plan on deleting to a temp feature class or file geodatabase until you are sure it works. Saves a lot of heartache if you have the records you deleted easily available to add back to the database.


I would use FeatureWriters to write the target records, then check the Summary ports to verify that the correct number of records was written. If yes, I'd use an SQLExecutor to delete the source record(s).

I am using FeatureWriters. I will use the Summary ports as you suggest. I will need to use a geodatabase writer to delete the source records since it is a SDE geodatabase. Thanks David.


I'm guessing you are using the database writers, the order of your writers in your table of contents is the order the operations will happen. So, if your delete writer is at the top it will delete first and then write. Right click on it and move down if it's higher than the writers.

 

You are probably better off using the FeatureWriters as @david_r​ says. Also, for now, write records you plan on deleting to a temp feature class or file geodatabase until you are sure it works. Saves a lot of heartache if you have the records you deleted easily available to add back to the database.

I am using FeatureWriters. Does FME honor the order of the writers if it is a FeatureWriter? Yeah, creating a backup just in case is always a good idea just in case something fails.


I am using FeatureWriters. I will use the Summary ports as you suggest. I will need to use a geodatabase writer to delete the source records since it is a SDE geodatabase. Thanks David.

You can actually use the SQLExecutor to delete features from a feature class, it's not a problem.

Additionally, there's the DatabaseDeleter transformer.


I am using FeatureWriters. Does FME honor the order of the writers if it is a FeatureWriter? Yeah, creating a backup just in case is always a good idea just in case something fails.

You can use the Summary output from the first FeatureWriter as the trigger for the second one, etc. That way you can be certain that they're triggered in the right order.


I am using FeatureWriters. Does FME honor the order of the writers if it is a FeatureWriter? Yeah, creating a backup just in case is always a good idea just in case something fails.

I have been using the Summary output as a trigger but I remember reading one time that the writes might not complete before the Summary is output so it has always concerned me even though I have never noticed a problem. I will look at the SQLExecutor and DatabaseDeleter as alternatives to the geodatabase writer. It's good to have options. Thanks to both of you, David.


Reply