[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

How can I get value of output parameter using DBI library

hongseok.yoon

5/22/2008 10:24:00 AM

I'm coding with DBI and MSSQL.

I've connected to the server with following line of code.

dbh = DBI.connect('DBI:ODBC:driver_name', 'user_name', 'user_pwd')

....and if it suppose that there's a stored procedure named add_user
has return value and three parameters(two are input param and the last
one is output param).

I've reeeeeeeeeeally tried to search the solution from the WEB and
just follow some code(e.g. http://ruby-oci8.rubyforge.org/en/FAQ_plsql_out_...).
Next several lines of code is it result...

sth_db = dbh.prepare("{ ? = call add_user(1, 'name', ?) }")
sth_db.bind_param(1, ' ' * 50)
sth_db.bind_param(2, ' ' * 50)
sth_db.execute
grp_sn = sth_db.func(:bind_value, 2)

....but, does not work!

How can I complete my job! Give me some clue~ plz!