Try extending mysql_adapter.rb and add this method:
def select_sp(sql, name = nil)
rows = select(sql, name = nil)
while (@connection.more_results?())
@connection.next_result()
end
return rows
end
Then call the SP using this method from your controller/model where
the sql param is: "call my_sp..."
On Aug 28, 1:10 am, Chris Dekker <[email protected]>
wrote:
> nas wrote:
> > Check this
>
> >http://nasir.wordpress.com/2007/12/03/stored-procedures-and-rails
>
> > On Aug 27, 3:09 pm, Chris Dekker <[email protected]>
>
> Thanks, but that link did not help me.
>
> For MYSQL it doesn't even work. Stored procedures are called through
> 'CALL', not 'EXECUTE'.
>
> Also as I wrote in my third post, I already get the stored procedure to
> execute, the problem seems to lie in the closing / freeing of the result
> set.
>
> Calling .free on the returned result set does not solve anything. Tested
> on both the latest 5.0 and 5.1 MySQL databases with the newest 2.8.1
> mysql gem
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---