Skip to main content
Question

delete from writer

  • August 11, 2015
  • 8 replies
  • 142 views

danpaoly
Contributor
Forum|alt.badge.img+1
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
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.

8 replies

takashi
Celebrity
  • August 12, 2015
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

danpaoly
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • August 12, 2015
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

takashi
Celebrity
  • August 12, 2015
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).

danpaoly
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • August 12, 2015
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

tfcw
Contributor
Forum|alt.badge.img+1
  • Contributor
  • August 12, 2015
What error message are you getting?

danpaoly
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • August 12, 2015
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

tfcw
Contributor
Forum|alt.badge.img+1
  • Contributor
  • August 12, 2015
Does your delete statement work if you try to run it to Oracle directly, like through SQL*Plus?

danpaoly
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • August 12, 2015
I do not access to test it directly on Oracle. My access is through ArcSDE with an editing account