Skip to main content
Solved

Is it possible to use pre-write SQL to delete features in a file geodatabase feature class?

  • December 15, 2020
  • 3 replies
  • 63 views

aguan
Supporter
Forum|alt.badge.img+11

I see the file geodatabase writer has pre and post writer SQL options. So I assume I can do some deletion before inserting. Can I do "delete from table where attribute = 'attributeValue'"? Not sure what the syntax should be.

 

Best answer by hkingsbury

A better approach would be to use a FeatureWriter to delete these features before they get written. You can add a WHERE Clause to filter out those you want to removeScreenshot 2020-12-16 080725

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

hkingsbury
Celebrity
Forum|alt.badge.img+65
  • Celebrity
  • Best Answer
  • December 15, 2020

A better approach would be to use a FeatureWriter to delete these features before they get written. You can add a WHERE Clause to filter out those you want to removeScreenshot 2020-12-16 080725


david_r
Celebrity
  • December 16, 2020

The problem is that the pre and post SQL does not have any notion of feature attributes, so you cannot reference any feature attributes in the SQL. However, you can reference private or public parameters.

If you need to delete based on a feature attribute, there is the DatabaseDeleter transformer, or you can look into the suggestion from @hkingsbury​ 


aguan
Supporter
Forum|alt.badge.img+11
  • Author
  • Supporter
  • December 17, 2020

@hkingsbury and @david_r, thanks for the advice. I will try use where clause. Basically delete existing records before inserting new ones. Use this for RDBM like Oracle all the time, never used against a file geodatabase.