M
Mohammad Khan
------=_Part_15462_765849.1127490566683
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
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 <http://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.
Thanks
Mohammad Khan
------=_Part_15462_765849.1127490566683--
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
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 <http://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.
Thanks
Mohammad Khan
------=_Part_15462_765849.1127490566683--