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
  • 46 views

aguan
Contributor
Forum|alt.badge.img+11
  • Contributor

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

View original
Did this help you find an answer to your question?

3 replies

hkingsbury
Celebrity
Forum|alt.badge.img+54
  • 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
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • 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.

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings