Call an Oracle function

If you just want to call a function you could do something like

results = ActiveRecord::Base.connection.select_all "select my_function ('some argument') value from dual" puts results.first['value']

For example

ActiveRecord::Base.connection.select_all "select 7+5 value from dual"

=> [{"value"=>12}]

If you have a more complicated plsql stored procedure that maybe sets more than one result parameter you can use the plsql gem GitHub - rsim/ruby-plsql: ruby-plsql gem provides simple Ruby API for calling Oracle PL/SQL procedures. It could be used both for accessing Oracle PL/SQL API procedures in legacy applications as well as it could be used to create PL/SQL unit tests using Ruby testing libraries.. This gem lets you call arbitrary plsql procedures with any input or output parameters.

Hope this helps --Alex