通过 Rails 调用存储过程? [英] Calling Stored procedure through Rails?

查看:30
本文介绍了通过 Rails 调用存储过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过 Rails 代码访问在 Mysql 中创建的存储过程?我目前正在为 rails 应用程序使用以下版本:-

How can i access Stored procedure created in Mysql through rails code? I am currently using following versions for rails application:-

Rails 2.1.0
红宝石企业版 2010.01

Rails 2.1.0
Ruby Enterprise Edition 2010.01

谢谢....

推荐答案

试试这个:ActiveRecord::Base.connection.execute("调用sp_name(param1,param2,.....)")

try this below: ActiveRecord::Base.connection.execute("call sp_name(param1,param2,.....)")

这篇关于通过 Rails 调用存储过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆