lib/uses_stored_procedures.rb
# Run the stored procedure with the arguments provided and send
# them through a filter method or block if specified.
Run the stored procedure with the arguments provided and send
them through a filter method or block if specified.
Run the stored procedure with the arguments provided and send them through a filter method or block if specified .
def exec_stored_proc(name, call_stored_proc_verb, filter, args) 
      sql = "{call_stored_proc_verb} {name} (" + args.map {|a| "'{a}'"}.join(',') + ")"
       TODO: investigate why stored procedures cause connection hangups.
      records = ActiveRecord::Base.connection.select_all(sql)
      ActiveRecord::Base.connection.reconnect!
      filter_stored_proc_results(records, filter)
    end
def exec_stored_proc ( name , call_stored_proc_verb , filter , args ) sql = "#{call_stored_proc_verb} #{name} (" + args . map { | a | "'#{a}'" } . join ( ',' ) + ")" records = ActiveRecord :: Base . connection . select_all ( sql ) ActiveRecord :: Base . connection . reconnect! filter_stored_proc_results ( records , filter ) end
Run the stored procedure with the arguments provided and send
them through a filter method or block if specified.
Run the stored procedure with the arguments provided and send them through a filter method or block if specified .
#:nodoc: # Call the stored procedure. Note the need to reset the connection # because the mysql connection tends to hangup when stored procedures # are called. Note that testing for ::connected? doesn't work. # # TODO: investigate why stored procedures cause connection hangups.
name
<not_specific>
call_stored_proc_verb
<not_specific>
filter
<not_specific>
args
<not_specific>