3

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
  • 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
    Commented May 5, 2015 at 10:49

1 Answer 1

6

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

4
  • Thanks. So what kind of transformer/reader should I make in order to have this list? Could it be also an excel file?
    – user1919
    Commented May 5, 2015 at 11:16
  • Yes Any reader that can carry the attribute value keys to delete.And yes excel works. Commented May 5, 2015 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
    Commented May 5, 2015 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. Commented May 6, 2015 at 14:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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