ODBC: Obtaining output params

K

keith.souhrada

I'm fairly new to Ruby, as well as using the ODBC library. So far, I've
had very little problems using it... running queries, stored procs,
etc. However, I cannot seem to get an output parameter from a stored
proc that I run.

Here's a basic example of my DB connection and queries...

------------------------------------------------------------------------------
require 'odbc'

dbcon = ODBC.connect( host, username, password )

outVar = -1
queryStatement = "call sp_TestSP( 2, #{@outVar} )"
query = dbcon.prepare( queryStatement )
query.execute()
------------------------------------------------------------------------------

At this point I can retrieve the return value if the stored proc
returns anything, but I cannot for my life figure out how to get the
output parameter that was set. @outVar is not changed, though I know
the stored proc is doing it internally.

Any help on retreiving an output param that is set would be great!

Thanks for any help!
 

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
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top