Skip to main content
Solved

How to update state machine

  • January 14, 2019
  • 2 replies
  • 38 views

Hi there,

I'm copying a table to other table in different oracle database. When the copy finishes, I need update a state field in source table (reader). How a reader could be transformed to a writer?

Best answer by mark2atsafe

As @david_r says, you could use a FeatureWriter transformer instead of a writer, then - as @arnovananrooij mentions - add a SQLExecutor to carry out an update.

The other solution is to use the writer parameter called SQL to Run After Write. You can put your SQL in there and it will run after the writer is complete.

To be honest, the FeatureWriter/SQLExecutor is a better way, because if the writer fails for some reason, you can choose not to run the SQL, but can alert an administrator instead (say with an Emailer transformer).

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

arnovananrooij
Contributor
Forum|alt.badge.img+5

You could use a sqlexecuter transformer to execute statements on any database


mark2atsafe
Safer
Forum|alt.badge.img+59
  • Safer
  • Best Answer
  • January 14, 2019

As @david_r says, you could use a FeatureWriter transformer instead of a writer, then - as @arnovananrooij mentions - add a SQLExecutor to carry out an update.

The other solution is to use the writer parameter called SQL to Run After Write. You can put your SQL in there and it will run after the writer is complete.

To be honest, the FeatureWriter/SQLExecutor is a better way, because if the writer fails for some reason, you can choose not to run the SQL, but can alert an administrator instead (say with an Emailer transformer).