Skip to content

Instantly share code, notes, and snippets.

@stubotnik
Created October 3, 2012 08:44
Show Gist options
  • Save stubotnik/3825846 to your computer and use it in GitHub Desktop.
Save stubotnik/3825846 to your computer and use it in GitHub Desktop.
Stored Proc return codes in Sequel
def self.return_code_test
return_code = @db.synchronize do |conn|
stmnt = conn.prepareCall('{ ? = call dbo.sp_tmp_stu_sequel_test() }')
stmnt.registerOutParameter(1, java::sql::Types::INTEGER)
stmnt.execute
# output parameters have not yet been processed, must call getMoreResults() first.
stmnt.getMoreResults
stmnt.getInt(1)
end
p "stored proc return code: #{return_code}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment