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 = [], options = {}) ⇒ ProcedureCall
constructor
A new instance of ProcedureCall.
Constructor Details
#initialize(procedure, args = [], options = {}) ⇒ ProcedureCall
Returns a new instance of ProcedureCall.
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/plsql/procedure_call.rb', line 4 def initialize(procedure, args = [], = {}) @procedure = procedure @schema = @procedure.schema @dbms_output_stream = @schema.dbms_output_stream @skip_self = [:skip_self] @self = [:self] @overload = get_overload_from_arguments_list(args) @procedure.ensure_tmp_tables_created(@overload) if @procedure.respond_to?(:ensure_tmp_tables_created) construct_sql(args) end |
Instance Method Details
#exec ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/plsql/procedure_call.rb', line 15 def exec # puts "DEBUG: sql = #{@sql.gsub("\n","<br/>\n")}" @cursor = @schema.connection.parse(@sql) @bind_values.each do |arg, value| @cursor.bind_param(":#{arg}", value, @bind_metadata[arg]) end @return_vars.each do |var| @cursor.bind_param(":#{var}", nil, @return_vars_metadata[var]) end @cursor.exec if block_given? yield get_return_value nil else get_return_value end ensure @cursor.close if @cursor dbms_output_log end |