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?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked May 5, 2015 at 10:40
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 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

answered May 5, 2015 at 11:08
4
  • Thanks. So what kind of transformer/reader should I make in order to have this list? Could it be also an excel file? 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. 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

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.