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?
-
1The 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/215590PolyGeo– PolyGeo ♦2015年05月05日 10:49:25 +00:00Commented May 5, 2015 at 10:49
1 Answer 1
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– user19192015年05月05日 11:16:40 +00:00Commented May 5, 2015 at 11:16
-
Yes Any reader that can carry the attribute value keys to delete.And yes excel works.Jorge Vidinha– Jorge Vidinha2015年05月05日 11:58:39 +00:00Commented May 5, 2015 at 11:58
-
1This SQL can also be placed in a writer (under advanced settings) to execute before/after the write - good for updates as well as deletions.2015年05月05日 13:30:44 +00:00Commented 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.Mark Ireland– Mark Ireland2015年05月06日 14:14:13 +00:00Commented May 6, 2015 at 14:14