Running mysql scripts from rails


#1

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


#2

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