【发布时间】:2018-12-04 13:50:16
【问题描述】:
我正在尝试使用带有 Sequel gem 的 ruby 存储过程;但它继续向我抛出 Mysql2::Error: Commands out of sync;你现在不能运行这个命令 运行存储过程后,在文档上找不到有关多语句查询的任何信息:
MyModel.db['CALL get_info("arg")').first
# => {col: val, col2: val}
MyModel.db['CALL get_info("arg")').first
# => Sequel::DatabaseDisconnectError: Mysql2::Error: Commands out of sync; you can't run this command now
from /usr/local/lib/ruby/gems/2.3.0/gems/mysql2-0.4.5/lib/mysql2/client.rb:120:in `_query'
【问题讨论】:
-
也许可以试试
MyModel.db.dataset.call_sproc(:select, 'get_info', 'arg')? Sequel::Dataset::StoredProcedures