How can I get value of output parameter using DBI library

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.
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)
grp_sn = sth_db.func(:bind_value, 2)

…but, does not work!

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs