How would I benifit from a stored procedure?
Stored procedures live with your data and can be called directly from inside queries. They can be customized to do what you want to the data before mysql gives it to you (SELECT) or after you feed it in, which is what you want for an insert.
so your stored procedure would be something like optimal_rate(date1,date2) where it did the logic I said before only it runs in your database server instead of your application (e.g. web server), and is more closely bound to the data.
so if you had such a stored procedure all you would have to
do when a user inputs booking dates is turn around and say
something like insert bookings (bookstart,bookend,rate) VALUES ($start,$stop,OPTIONAL_RATE($start,$stop))
well you'd need to get the syntax right but your application code would be much simpler and the crunching would be done by the DBMS instead of your application. especilly nice if the DBMS is on sombody else's nickel.;)
Like the previous poster said, for now version 5 is still a little on
the bleeding edge to use for production but I've heard
it supports stored procedures. I used them in postgres and they are a pain to write but nice once you get them.
Kind regards Kevin
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]