我可以在 ruby on Rails 中使用存储过程吗?
我使用 mysql 作为数据库,使用 ruby on Rails。
请为我提供任何相关示例。
最佳答案
Duplicate ? 如果没有:
class MyRubyClass < ActiveRecord::Base
def self.select_some_records
connection.select_all "exec mysql_stored_proc 'argument1', 'argument2'"
end
end
要启用存储过程,请查看 this
关于mysql - 我可以在 ruby on Rails 中使用存储过程吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2032959/