views:

289

answers:

2

does rails activerecord have any support for prepared statements? best I can tell -no.

A: 

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.

Veger
+1  A: 

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:

Andrew Kuklewicz
Latest version of rails 2.3.5 has better stored proc support.
Andrew Kuklewicz