How can I get value of output parameter using DBI library

H

hongseok.yoon

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_param.html).
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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,668
Latest member
SamiraShac

Latest Threads

Top