When a new row in database is added, an external command line program must be invoked

后端 未结 4 1011
长发绾君心
长发绾君心 2020-12-01 23:00

Is it possible for MySQL database to invoke an external exe file when a new row is added to one of the tables in the database?

I need to monitor the changes in the

4条回答
  •  星月不相逢
    2020-12-01 23:09

    I think it's really a MUCH better idea to have some external process poll changes to the table and execute the external program - you could also have a column which contains the status of this external program run (e.g. "pending", "failed", "success") - and just select rows where that column is "pending".

    It depends how soon the batch job needs to be run. If it's something which needs to be run "sooner or later" and can fail and need to be retried, definitely have an app polling the table and running them as necessary.

提交回复
热议问题