Guy Harrison, Steven Feuerstein9780596100896, 0596100892
In the decade since MySQL burst on the scene, it has become the dominant open source database, with capabilities and performance rivaling those of commercial RDBMS offerings like Oracle and SQL Server. Along with Linux and PHP, MySQL is at the heart of millions of applications. And now, with support for stored procedures, functions, and triggers in MySQL 5.0, MySQL offers the programming power needed for true enterprise use.
MySQL’s new procedural language has a straightforward syntax, making it easy to write simple programs. But it’s not so easy to write secure, easily maintained, high-performance, and bug-free programs. Few in the MySQL world have substantial experience yet with stored procedures, but Guy Harrison and Steven Feuerstein have decades of combined expertise.
In MySQL Stored Procedure Programming, they put that hard-won experience to good use. Packed with code examples and covering everything from language basics to application building to advanced tuning and best practices, this highly readable book is the one-stop guide to MySQL development. It consists of four major sections:
– MySQL stored programming fundamentals — tutorial, basic statements, SQL in stored programs, and error handling
– Building MySQL stored programs — transaction handling, built-in functions, stored functions, and triggers
– MySQL stored programs in applications — using stored programs with PHP, Java, Perl, Python, and .NET (C# and VB.NET)
– Optimizing MySQL stored programs — security, basic and advanced SQL tuning, optimizing stored program code, and programming best practices
A companion web site contains many thousands of lines of code, that you can put to use immediately.
Guy Harrison is Chief Architect of Database Solutions at Quest Software and a frequent speaker and writer on MySQL topics. Steven Feuerstein is the author of Oracle PL/SQL Programming, the classic reference for Oracle stored programming for more than ten years. Both have decades of experience as database developers, and between them they have authored a dozen books.
Table of contents :
A MySQL® Technical White Paper……Page 1
Introduction……Page 2
A Definition and an Example……Page 3
Why Stored Procedures……Page 4
Check for the Correct Version……Page 5
The Sample “Database”……Page 6
Procedure names can be delimited. If the name is delimited,……Page 7
Why MySQL Statements are Legal in a Procedure Body……Page 8
Call the Procedure……Page 9
3…….Page 10
6…….Page 11
Answer……Page 12
Parameters……Page 13
Compound Statements……Page 14
There are several ways to initialize a variable. When declar……Page 15
Scope……Page 16
2…….Page 17
5…….Page 18
1…….Page 19
Answer……Page 20
WHILE … END WHILE example……Page 21
REPEAT … END REPEAT: look at the UNTIL……Page 22
LOOP … END LOOP: with IF and LEAVE……Page 23
End Labels……Page 24
ITERATE……Page 25
ITERATE: Walking through the loop……Page 26
ITERATE: walking through the loop……Page 27
GOTO……Page 28
1. Sample Problem: Log Of Failures……Page 29
5. Sample Problem: Log Of Errors……Page 30
DECLARE CONTINUE HANDLER……Page 31
DECLARE CONTINUE HANDLER example……Page 32
DECLARE CONTINUE HANDLER example……Page 33
2. DECLARE CONDITION……Page 34
Cursors……Page 35
Cursor Example……Page 36
Cursor Example……Page 37
Cursor Example……Page 38
8. Cursor Example……Page 39
Cursor Example……Page 40
Privileges EXECUTE……Page 41
Privileges Invokers and Definers……Page 42
2. Examples……Page 43
Show……Page 44
SELECT from information_schema: My Favourite……Page 45
Additional clause in SHOW PROCEDURE STATUS……Page 47
Oracle Comparison……Page 48
SQL Server Comparison……Page 49
DB2 Comparison……Page 50
Standard Comparison……Page 51
Style……Page 52
Stored Procedure Example: tables_concat()……Page 53
Procedure Example: MyISAM “Foreign Key” insertion……Page 55
Procedure Example: Error Propagation……Page 57
Procedure Example: Library……Page 58
Procedure Example: Hierarchy (I)……Page 60
Tips when writing long routines……Page 63
Bugs……Page 64
Web Pages Of MySQL……Page 65
About MySQL……Page 66
Reviews
There are no reviews yet.