3
我有使用activerecord從數據庫訪問數據。它在localhost中正常工作,但當我嘗試它時另一臺服務器,我收到以下錯誤:ActiveRecord :: StatementInvalid(Mysql :: Error:PROCEDURE db_name.proc_spName無法返回給定上下文中的結果集:
ActiveRecord::StatementInvalid (Mysql::Error: PROCEDURE db_name.proc_spName can't return a result set in the given context: CALL proc_spName(............)):
/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:188:in `log'
/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:310:in `execute'
/app/controllers/keywordprocessor_controller.rb:306:in `result'
/vendor/rails/actionpack/lib/action_controller/base.rb:1256:in `send'
BTW,下面是我遇到下面的錯誤
sql = "CALL proc_getresults"
res = ActiveRecord::Base.connection.execute(sql)
任何想法,將不勝感激行..
有可能是有用的答案類似的問題被問已經在這裏:http://stackoverflow.com/questions/471517/is-it-possible-to-call-a-mysql-stored-procedure-from -紅寶石 – bjg 2010-07-12 11:21:12