Skip to content

Instantly share code, notes, and snippets.

@gmgent
Created March 8, 2011 19:35
Show Gist options
  • Select an option

  • Save gmgent/860862 to your computer and use it in GitHub Desktop.

Select an option

Save gmgent/860862 to your computer and use it in GitHub Desktop.
def forecast
x = params[:revplan_id].to_i
@revplan = Revplan.find(x)
sql = ActiveRecord::Base.connection();
sql.execute "SET autocommit=0";
sql.begin_db_transaction
execution_string="call sp_generate_forecast(#{Time.now.month}, #{Time.now.year}, _
#{x}, #{month_days(Time.now.month)})"
result = sql.execute(execution_string)
sql.commit_db_transaction
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment