Class: JDBCHelper::FunctionWrapper
- Inherits:
-
ObjectWrapper
- Object
- ObjectWrapper
- JDBCHelper::FunctionWrapper
- Defined in:
- lib/jdbc-helper/wrapper/function_wrapper.rb
Overview
conn.function(:coalesce).call(nil, nil, ‘king’)
Instance Attribute Summary
Attributes inherited from ObjectWrapper
Instance Method Summary collapse
-
#call(*args) ⇒ Object
Returns the result of the function call with the given parameters.
Methods inherited from ObjectWrapper
Constructor Details
This class inherits a constructor from JDBCHelper::ObjectWrapper
Instance Method Details
#call(*args) ⇒ Object
Returns the result of the function call with the given parameters
15 16 17 18 19 20 21 22 |
# File 'lib/jdbc-helper/wrapper/function_wrapper.rb', line 15 def call(*args) pstmt = @connection.prepare("select #{name}(#{args.map{'?'}.join ','}) from dual") begin pstmt.query(*args)[0][0] ensure pstmt.close end end |