Skip to main content
I need to update a set of records on a weekly basis.  Before updating the data in the writer I need to delete the old data from the writer.  I would like to use a simple selection that meets a query such as Area = Utica.  

 

 

Ideally all the data where Area = Utica is deleted from the writer, the data that does not satisfy my query would remain.  After deleting the records I would then load my new data.

 

 

thanks

 

Dan
Hi Dan,

 

 

If the destination dataset is a database, the "SQL Statement to Execute Before Translation" parameter of the writer can be used to delete records which match a certain condition before writing new records.

 

-----

 

delete from <table_name> where <condition>

 

 

Takashi
Thanks, Is it possible to have multiple delete statements? I am working with a SDE writer that has multiple feature classes in my workbench. I need to delete from multiple feature classes but am only able to get the SQL Statement to Execute Before Translation parameter to work with one DELETE statement. Dan
Yes, it's possible.

 

-----

 

FME_SQL_DELIMITER ;

 

delete from <table1> where <condition1>;

 

delete from <table2> where <condition2>;

 

delete from <table3> where <condition3>;

 

-----

 

Regarding the first declaration "FME_SQL_DELIMITER ;", see the help doc for the SQLExecutor or the SQLCreator (description about SQL Statement parameter).
Thanks again for your help. My data is in an Oracle base ArcSDE, for some reason the DELETE statement is not working DELETE FROM EGIS.NOP_PIPELINES WHERE FRANCHISE in ('ANADARKO BASIN','BARNETT','EAGLE FORD','HAYNESVILLE MANSFIELD','HAYNESVILLE SPRINGRIDGE','MARCELLUS NORTH','MARCELLUS SOUTH','MID-CONTINENT NORTH','MID-CONTINENT SOUTH','NIOBRARA','PERMIAN','UTICA') EGIS.NOP_PIPELINES is the featureclass name I am trying to delete from
What error message are you getting?
I am not getting an error message, the features are just not deleting. I put my DELETE statement in the SQL Statement to Execute Before Translation. The data is an Oracle based ArcSDE featureclass with versioning. Dan
Does your delete statement work if you try to run it to Oracle directly, like through SQL*Plus?
I do not access to test it directly on Oracle. My access is through ArcSDE with an editing account

Reply