title: how to call stored procedure in ruby on rails?
body: <p>I am new to ROR. I want to call the Stored Procedure to process when I click the submit button in the VIEW. </p>
  
  <pre><code>    Model:
      -------
  
      class Pro::DataImport &lt; ActiveRecord::Base
        attr_accessible :file_name, :process_name, :updated_by, :validates
  
      end
  
      Controller:
      -----------------
  
      class Pro::DataImportsController &lt; ApplicationController
         before_filter :authenticate_user!
        layout "layouts/enr/energy_master"
  
        def index
         @pro_data_imports = Pro::DataImport.all 
        end
  
        def new
          @pro_data_import = Pro::DataImport.new
        end
  
      end
  
      View
      ----------
  
       &lt;%= form_for @pro_data_import do %&gt;
  
    &lt;div class="field"&gt;
      Browse the file to upload:&lt;br /&gt;
      &lt;%= file_field_tag ':file_name' %&gt;
    &lt;/div&gt;
  
    &lt;div class="actions"&gt;
      &lt;%= submit_tag 'Import File' %&gt;
    &lt;/div&gt;
  &lt;% end %&gt;
  
  
      Stored Proc
      ---------------
  
      ALTER PROCEDURE "DBA"."my_enr_test"(file_name long varchar)
      BEGIN
          INSERT INTO DBA.pro_data_imports(file_name) values(file_name);
      END
  </code></pre>
  
  <p>Thanks in Advance.. Please Help me. I want to get the filepath from the upload button and store into the database column file_name. How to execute the store procedure for the submit button. Please help me!!</p>