From: "Peña, Botp" Date: 2008-06-06T13:49:23+09:00 Subject: Re: Newbie question concerning ruby and mysql From: Michael Litchard [mailto:michael@schmong.org] # # # read each line from file, split into values, and insert # into database # File.open("zips.csv", "r") do |f| # f.each_line do |line| # zip,st_abv,latitude,longitude,city,state = line.chomp.split(",") # sth.execute(zip, st_abv, latitude, longitude, city, state) # end # end # # # Here's the error # # # ./create_db.rb # An error occurred # Error code: 1062 # Error message: Duplicate entry '0' for key 1 that's no problem, since you're inserting records per line, just get the (csv) line that triggered the error. btw, i do not see any conversion, is that automatic in mysql dbi? kind regards -botp