I have a PostgreSQL database which I initialized through FME. What I want to do now is to delete some values from the database. How can I do that? I am trying to use SQLExecutor but I don't know what to put in the input parameter called initiator. Actually I don't quite understand why I need an input parameter. I just want to connect to the database and delete some values from the table.

What would be the workflow for this?

  • 1
    The undesirability of having question titles pre-fixed by what is effectively a duplication of the main tag has been discussed by the founder of Stack Overflow/Exchange at meta.stackexchange.com/a/10651/215590 – PolyGeo May 5 '15 at 10:49

You can go with the SQLExecuter, the initiator would need to be a list of database values [keys] you want to delete. Then using something similar the SQL statement below to execute the delete query should work.

DELETE FROM table WHERE key = '@Value(key)';

Or you can use the DatabaseDeleter

  • Thanks. So what kind of transformer/reader should I make in order to have this list? Could it be also an excel file? – user1919 May 5 '15 at 11:16
  • Yes Any reader that can carry the attribute value keys to delete.And yes excel works. – Jorge Vidinha May 5 '15 at 11:58
  • 1
    This SQL can also be placed in a writer (under advanced settings) to execute before/after the write - good for updates as well as deletions. – Mapperz May 5 '15 at 13:30
  • You would connect a flow of data to the transformer, if you wanted to run the command once for each feature. Otherwise, to run the transformer just once, connect a Creator transformer to it. – Mark Ireland May 6 '15 at 14:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.