[Instantrails-users] Instead of using the command line

William (Bill) Froelich wfroelich at dbsnow.com
Mon Aug 20 01:48:20 EDT 2007

There are a number of ways that you can accomplish this.  I am assuming
you are using MySQL as the database.
1) You could use this as an opportunity to write a parser / importer in
Ruby using fastercsv or similar.
2) Do a bulk import to MySQL as described at the following link
3) Setup the data file and use rake.
4) Find a tool that supports the bulk import to MySQL.
How you approach it depends primarily on your current need.  #1 & #3
give you an opportunity to learn more about Ruby and database
interactions but #2 is probably the quickest to implement since it
should be existing functionality. 
Note: I have not tested any of these approaches directly with MySQL but
do use the Oracle equivalent of #2 frequently.
Hope this helps!
--Bill Froelich


	From: instantrails-users-bounces at rubyforge.org
[mailto:instantrails-users-bounces at rubyforge.org] On Behalf Of Walker
Web Data
	Sent: Sunday, August 19, 2007 6:18 AM
	To: Instantrails-users at rubyforge.org
	Subject: [Instantrails-users] Instead of using the command line
	Instead of using the command line to, for example, insert
records individually, is it possible to use an easier way such as having
a number of records in an external file and inserting them all at once?
	Thank you.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/instantrails-users/attachments/20070820/2ea9750b/attachment.html 

More information about the Instantrails-users mailing list