Topic: Executing an external .sql file
I need to execute an external .sql file. I'm guessing
Well what I really need to do is input a large amount of data into a mySQL data base via rails.
This would work like a stored procedure in MSSQL. Maybe I just need to know how to execute my own SQL from a controller?? I'm just not sure. I have outlined below what I am trying to do.
Sorry I am very new to Rails.
thanks for you help
#Create a new week
INSERT INTO weeks(id, user_id, name)
#find the identity of the new week and set it to week_id.
#loop this seven times for the days of the week.
INSERT INTO days(id, title, week_id)
#find the identity of the day and set the day_id
#Create hours for each day
#Loop 24 time per day.
INSERT INTO hours(id, title, day_id)
#end hour loop
#end day loop