Walker Web Data
2007-Aug-19 11:18 UTC
[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/20070819/b1bf4669/attachment.html
William (Bill) Froelich
2007-Aug-20 05:48 UTC
[Instantrails-users] Instead of using the command line
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 http://www.modwest.com/help/kb6-253.html 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
Walker Web Data
2007-Aug-20 07:34 UTC
[Instantrails-users] Instead of using the command line
Thank you, Bill. On 8/20/07, William (Bill) Froelich <wfroelich at dbsnow.com> wrote:> > 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 > http://www.modwest.com/help/kb6-253.html > > 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. > > > _______________________________________________ > Instantrails-users mailing list > Instantrails-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/instantrails-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/instantrails-users/attachments/20070820/d7f24804/attachment.html