Skip to content

Instantly share code, notes, and snippets.

@adamgamble
Created October 27, 2010 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamgamble/650040 to your computer and use it in GitHub Desktop.
Save adamgamble/650040 to your computer and use it in GitHub Desktop.
insert_sql << "INSERT INTO negative_balance_reports (bank, agent, store_number, name, ssn, pan, overdraft, their_balance, our_balance, overdraft_limit, account_type) VALUES "
@rows.each do |row|
insert_sql << "('#{@bank}', '#{row[0]}', '#{row[1]}', '#{row[2].gsub("'","''")}', '#{row[3]}', '#{row[4]}', '#{row[5]}', '#{row[6]}', '#{row[7]}', '#{row[8] == "N/A" ? 0 : row[8]}', '#{row[9]}'),"
end
NegativeBalanceReport.connection.execute(insert_sql.string.chop + ";")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment