Get return from oracle procedure

Hi all,
I have a procedure in which I pass two integers and two dates and get
two integer as the result.How could I read the response with ROR?

Here´s my code:
ActiveRecord::Base.connection.execute("DECLARE RESULTV NUMBER; RESULTBC

How could I fetch the value of the RESULTV and RESULTBC variables?
Rafael Roque

Doesn't that return a resultset?

It should return me two integers,but it´s returning "1".

It should return me two integers,but it´s returning "1".

OK, sorry -- I don't know anything about Oracle procedures, but if I
execute a query using ActiveRecord::Base.connection.execute(sql)
it returns a resultset, e.g. (via script/console)

result = ActiveRecord::Base.connection.execute("select 1")

=> #<Mysql::Result:0x1fe43a8>


=> ["1"]


This doesn’t answer your question directly, but you might want to read
about how to obtain Oracle debug output in your Rails app/log file:

I believe Alex’s patch was recently added to the Oracle Enhanced
Adapter... if you’re using that and upgrade to the latest version that
includes the patch, you’ll be able to put some debug/log code in your
PL/SQL and get maybe get some idea of what’s going on.

- pat

I believe the problem that oracle procedures do not return a value
(oracle defines procedures and functions differently).

The easiest way to interact with PLSQL procedures is to use the plsql
gem or
Read through the ruby-plsql documentation to see exactly how to use it
but it will be something like:

# you could name the argurments
with :a_number=>112, :start_date=>'21/10/2009' etc. based on the
parameters of podeviajar
result = plsql.podeviajar(112, '21/10/2009', '22/10/2009', 1,
puts result[:RESULTV]
puts result[:RESULTBC]

Hope this helps