I am trying to document a Mirth channel with Connector Type: Database Reader. It has a SQL statement that it uses to read input to the Mirth ch开发者_运维百科annel. But then it has another box called On-Update SQL with more SQL code. Does that SQL run after the SQL input statement? What does the On-Update Statement do?
On-Update SQL should be used to update a record once it has been read so that it is not read again. For example, if your SQL statement is:
SELECT id, firstName, lastName FROM person WHERE status = 0;
Then should have the On-Update SQL as:
UPDATE person SET status = 1 WHERE id = ${id};
Notice that the ${id}
variable is used. This would be replaced with the ID value selected in the original SQL statement. This allows you to update the same record that was selected.
You can use any of the columns in your UPDATE that you retrieve in your SELECT (ex. ${firstName}
).
Source
精彩评论