Forum: Ruby on Rails Running mysql scripts from rails.

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Larry K. (Guest)
on 2006-02-22 17:13
(Received via mailing list)
How do I run SQL scripts from rails?

I have a testing menu item called "import data".
How can I get it to call a SQL script file that will import the data
into a
MySQL table for me?



--
Best Regards,
-Larry
"Work, work, work...there is no satisfactory alternative."
            --- E.Taft Benson
Joe B. (Guest)
on 2006-02-22 17:32
hi Larry
try this
#---------------------------------------------------------------
ActiveRecord::Base.connection.excute(sql_str)
#---------------------------------------------------------------

regards


Larry K. wrote:
> How do I run SQL scripts from rails?
>
> I have a testing menu item called "import data".
> How can I get it to call a SQL script file that will import the data
> into a
> MySQL table for me?
>
>
>
> --
> Best Regards,
> -Larry
> "Work, work, work...there is no satisfactory alternative."
>             --- E.Taft Benson
This topic is locked and can not be replied to.