Class: JDBCHelper::ProcedureWrapper
- Inherits:
-
ObjectWrapper
- Object
- ObjectWrapper
- JDBCHelper::ProcedureWrapper
- Defined in:
- lib/jdbc-helper/wrapper/procedure_wrapper.rb
Overview
conn.function(:coalesce).call(nil, nil, ‘king’)
Instance Attribute Summary
Attributes inherited from ObjectWrapper
Instance Method Summary collapse
-
#call(*args) ⇒ Hash
Executes the procedure and returns the values of INOUT & OUT parameters in Hash.
Methods inherited from ObjectWrapper
Constructor Details
This class inherits a constructor from JDBCHelper::ObjectWrapper
Instance Method Details
#call(*args) ⇒ Hash
Executes the procedure and returns the values of INOUT & OUT parameters in Hash
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/jdbc-helper/wrapper/procedure_wrapper.rb', line 16 def call(*args) param_count = args.first.kind_of?(Hash) ? args.first.keys.length : args.length cstmt = @connection.prepare_call "{call #{name}(#{Array.new(param_count){'?'}.join ', '})}" begin cstmt.call *args ensure cstmt.close end end |