From: Michael Litchard Date: 2008-06-06T14:12:36+09:00 Subject: Re: Newbie question concerning ruby and mysql ------=_Part_6151_7653794.1212729221311 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline There is no conversion, I figured out just now that I needed to do that. So now I am figuring out the syntax of using the output of one function as the input for another. That's tomorrow's problem. I'll give it a go and see what happens. On Thu, Jun 5, 2008 at 9:49 PM, Pe=F1a, Botp wrote= : > 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 =3D 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 > > ------=_Part_6151_7653794.1212729221311--