December 2005
Intermediate to advanced
336 pages
4h 52m
English
In this chapter, you’ll learn what stored procedures are, why they are used, and how they are used. You’ll also look at the basic syntax for creating and using them.
Requires MySQL 5. Support for stored procedures was added to MySQL 5. As such, this chapter is applicable to MySQL 5 or later only.
Most of the SQL statements that we’ve used thus far are simple in that they use a single statement against one or more tables. Not all operations are that simple—often, multiple statements will be needed to perform a complete operation. For example, consider the following scenario:
To process an order, checks must be made to ensure that items are in stock.
If items are in stock, ...
Read now
Unlock full access