does rails activerecord have any support for prepared stat开发者_如何学编程ements? best I can tell -no.
Since Rails 3.1 prepared statements in active_record are in place. See this presentation http://www.youtube.com/watch?v=kWOAHIpmLAI by Aaron Patterson.
There are recent patches available to do this for mysql:
https://rails.lighthouseapp.com/projects/8994/tickets/3151-mysql-adapter-update-to-enable-use-of-stored-procedures
For Oracle, there are 2 related projects that seem like they do the trick:
plsql support http://github.com/rsim/ruby-plsql
more goodies when using Oracle and AR, with use of ruby-plsql gem for stored procs http://wiki.github.com/rsim/oracle-enhanced/
It has some support for it, shown in this guide, but it is only syntactic support, since the ActiveRecord replaces the question marks with their values before sending to the database.
Some people (here for example) seem(ed) to be busy with prepared statement support, but no available/working results seem to be integrated into rails yet.
精彩评论