【发布时间】:2009-01-23 01:21:24
【问题描述】:
当我尝试从 Rails 调用存储过程时,我得到了这个异常:
ActiveRecord::StatementInvalid: Mysql::Error: PROCEDURE pipeline-ws_development.match_save_all can't return a result set in the given context: call match_save_all()
from /Users/otto/Projects/Futures/src/pipeline-ws/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:150:in `log'
from /Users/otto/Projects/Futures/src/pipeline-ws/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:281:in `execute'
from (irb):3
Rails Wiki that discusses a patch 中有一个页面用于解决此问题的 MySQL 适配器,但它已经过时并且似乎不再工作了。
配置代码正确启用存储过程,但在存储过程调用后仍然存在连接不同步的问题,并且新的call_sp 方法不再起作用。
关于如何使它工作的任何建议?
这是我正在使用的代码:
ActiveRecord::Base.connection("call storedproc()")
无论storedproc()是否返回任何结果,它都会抛出相同的异常。
【问题讨论】:
标签: mysql ruby-on-rails stored-procedures