I building an application that will require the admin to create bus schedules based on a DAYNAME(Monday,..) in a particular MONTH(September,..) and in a particular YEAR(2012). So for every Monday in September, 2o12 the bus schedules will be added. This will happen too if the bus has a Tuesday Schedule, Wednesday, etc.
So I want this to run iteratively too, so for all the month in 2012 or 2013, for every monday add a bus schedule
I have a single table with columns; dept_time,_dept_date,date_of_travel etc.
I think a stored procedure will be the best solution.
Please I need ideas on how to implement this.
Thank you.
Stored procedure is not always a best solution (at least not in this case).
All you need is to create client side script or program (use Python, Perl, PHP, Java, etc) that will parse (and possibly validate) your business logic, and then insert records into your table according to that logic. This script should be the only entity that adds/updates records.
Finally, users will read (select) information from your table and use it as schedule.