How can we connect mysql trigger with Ruby on Rails 3?

谁说我不能喝 提交于 2019-12-24 09:57:46

问题


I'm working on a ROR 3 app which uses mysql as the database. Now I want a trigger every time col1 of table1 is updated. But I also want the values of both col1 and col2 of that row in my rails controllers after the trigger is completed ( so as to update an dynamic progress bar ) ... What approach can I follow for this??


回答1:


Please check this manual entry to define a trigger on your table.

A trigger will block the trigggering operation until the trigger completes. There is nothing else to do, just wait until your main query ends.

A trigger has no return value. When your update completes (which means your trigger completed too), issue a separate SELECT statement.



来源:https://stackoverflow.com/questions/18655144/how-can-we-connect-mysql-trigger-with-ruby-on-rails-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!