Skip to content

Instantly share code, notes, and snippets.

@t11a
Created March 6, 2013 10:31
Show Gist options
  • Save t11a/5098403 to your computer and use it in GitHub Desktop.
Save t11a/5098403 to your computer and use it in GitHub Desktop.
sql = "LOAD DATA LOCAL INFILE '#{csv_file}' INTO TABLE tblname FIELDS TERMINATED BY ',' LINES TERMINATED BY '\\n'"
ActiveRecord::Base.connection.execute(sql)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment