Class: PLSQL::ProcedureCall
- Inherits:
-
Object
- Object
- PLSQL::ProcedureCall
- Defined in:
- lib/plsql/procedure_call.rb
Overview
:nodoc:
Instance Method Summary collapse
- #exec ⇒ Object
-
#initialize(procedure, args = []) ⇒ ProcedureCall
constructor
A new instance of ProcedureCall.
Constructor Details
#initialize(procedure, args = []) ⇒ ProcedureCall
Returns a new instance of ProcedureCall.
4 5 6 7 8 9 10 |
# File 'lib/plsql/procedure_call.rb', line 4 def initialize(procedure, args = []) @procedure = procedure @schema = @procedure.schema @dbms_output_stream = @schema.dbms_output_stream @overload = get_overload_from_arguments_list(args) construct_sql(args) end |
Instance Method Details
#exec ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/plsql/procedure_call.rb', line 12 def exec @cursor = @schema.connection.parse(@sql) @bind_values.each do |arg, value| @cursor.bind_param(":#{arg}", value, [arg]) end @return_vars.each do |var| @cursor.bind_param(":#{var}", nil, [var]) end @cursor.exec dbms_output_log if block_given? yield get_return_value nil else get_return_value end ensure @cursor.close if @cursor end |