From: Mohammad Khan Date: 2005-09-24T14:22:26+09:00 Subject: Re: activerecord question ------=_Part_18854_5082088.1127539343589 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 9/23/05, Eric Hodel wrote: > > On 23 Sep 2005, at 08:49, Mohammad Khan wrote: > > > My piece of code is below, (consider Country is subclass > > ActiveReocrd::Base) > > > > File.open("country.list").each do | line | > > line.strip! > > name, code =3D line.split("\t") > > > > c =3D Country.new > > c.name =3D name > > c.code =3D code > > c.save > > end > > > > This piece of code is inserting rows in countries table. > > and the number of insert statement is equal to the number of lines in > > country.list > > > > Is there any way to save those rows by one method. > > What I want is not to send 100 insert statement to database server, > > I want > > to send only one insert statement in database server. > > http://lists.rubyonrails.org/mailman/listinfo/rails > > Has your answer. > > -- > Eric Hodel - drbrain@segment7.net - http://segment7.net > FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 Thanks, Eric. I have joined to that list Mohammad ------=_Part_18854_5082088.1127539343589--