Anyone who has worked with me knows that I am a big fan of MySQL. I’ve heard a lot of unfounded complaints about “getting a real database solution” from people who simply haven’t done their homework over the years. MySQL may have been a toy database around version 3, but that was a decade ago. Now, it is neck and neck with Oracle when it comes to performance, and still typically out-performs Microsoft’s SQL Server and other competitors.
MySQL has also become much more feature rich over the past few years, adding support for triggers, stored functions, and stored procedures. However, not many people have taken advantage of these new features; if you try to search Google for examples, they are almost non-existent, and the tutorials I have found have been far too basic to be useful. The advantages of stored procedures are many, but the two big advantages are that they are compiled, increasing speed, and can help prevent SQL injection attacks.
I was lucky enough to stumble upon this attached white paper. It is a PDF from MySQL that walks through most of the features of stored procedure programming. Since I haven’t been able to find it on Google, I figured I would include it here. (Thank you, Paul, for sending me the PDF!)