Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

share|improve this question
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 at 10:49

1 Answer 1

up vote 4 down vote accepted

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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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