

Instant online reading.
Don't wait for delivery!
At a Glance
636 Pages
23.3 x 18.0 x 3.4
Paperback
RRP $85.50
$43.75
49%OFF
or 4 interest-free payments of $10.94 with
orAims to ship in 15 to 25 business days
When will this arrive by?
Enter delivery postcode to estimate
The implementation of stored procedures in MySQL 5.0 a huge milestone - one that is expected to lead to widespread enterprise adoption of the already extremely popular MySQL database. If you are serious about building the web-based database applications of the future, you need to get up to speed quickly on how stored procedures work - and how to build them the right way. This book, destined to be the bible of stored procedure development, is a resource that no real MySQL programmer can afford to do without. 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); and, 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.
Preface | p. xiii |
Stored Programming Fundamentals | |
Introduction to MySQL Stored Programs | p. 3 |
What Is a Stored Program? | p. 3 |
A Quick Tour | p. 7 |
Resources for Developers Using Stored Programs | p. 13 |
Some Words of Advice for Developers | p. 15 |
Conclusion | p. 19 |
MySQL Stored Programming Tutorial | p. 20 |
What You Will Need | p. 20 |
Our First Stored Procedure | p. 20 |
Variables | p. 25 |
Parameters | p. 25 |
Conditional Execution | p. 30 |
Loops | p. 31 |
Dealing with Errors | p. 32 |
Interacting with the Database | p. 33 |
Calling Stored Programs from Stored Programs | p. 38 |
Putting It All Together | p. 39 |
Stored Functions | p. 41 |
Triggers | p. 43 |
Calling a Stored Procedure from PHP | p. 45 |
Conclusion | p. 46 |
Language Fundamentals | p. 49 |
Variables, Literals, Parameters, and Comments | p. 49 |
Operators | p. 60 |
Expressions | p. 64 |
Built-in Functions | p. 64 |
Data Types | p. 68 |
MySQL 5 "Strict" Mode | p. 72 |
Conclusion | p. 76 |
Blocks, Conditional Statements, and Iterative Programming | p. 77 |
Block Structure of Stored Programs | p. 77 |
Conditional Control | p. 82 |
Iterative Processing with Loops | p. 93 |
Conclusion | p. 98 |
Using SQL in Stored Programming | p. 99 |
Using Non-Select SQL in Stored Programs | p. 99 |
Using Select Statements with an Into Clause | p. 100 |
Creating and Using Cursors | p. 101 |
Using Unbounded Select Statements | p. 112 |
Performing Dynamic SQL with Prepared Statements | p. 118 |
Handling SQL Errors: A Preview | p. 123 |
Conclusion | p. 124 |
Error Handling | p. 125 |
Introduction to Error Handling | p. 125 |
Condition Handlers | p. 129 |
Named Conditions | p. 139 |
Missing SQL:2003 Features | p. 139 |
Putting It All Together | p. 145 |
Handling Stored Program Errors in the Calling Application | p. 150 |
Conclusion | p. 155 |
Stored Program Construction | |
Creating and Maintaining Stored Programs | p. 159 |
Creating Stored Programs | p. 159 |
Editing an Existing Stored Program | p. 166 |
SQL Statements for Managing Stored Programs | p. 170 |
Getting Information About Stored Programs | p. 173 |
Conclusion | p. 176 |
Transaction Management | p. 179 |
Transactional Support in MySQL | p. 180 |
Defining a Transaction | p. 183 |
Working with Savepoints | p. 185 |
Transactions and Locks | p. 190 |
Transaction Design Guidelines | p. 201 |
Conclusion | p. 203 |
MySQL Built-in Functions | p. 205 |
String Functions | p. 205 |
Numeric Functions | p. 218 |
Date and Time Functions | p. 223 |
Other Functions | p. 233 |
Conclusion | p. 237 |
Stored Functions | p. 238 |
Creating Stored Functions | p. 238 |
SQL Statements in Stored Functions | p. 242 |
Calling Stored Functions | p. 242 |
Using Stored Functions in SQL | p. 244 |
Conclusion | p. 248 |
Triggers | p. 249 |
Creating Triggers | p. 249 |
Using Triggers | p. 251 |
Trigger Overhead | p. 256 |
Conclusion | p. 257 |
Using MySQL Stored Programs in Applications | |
Using MySQL Stored Programs in Applications | p. 261 |
The Pros and Cons of Stored Programs in Modern Applications | p. 261 |
Advantages of Stored Programs | p. 264 |
Disadvantages of Stored Programs | p. 268 |
Calling Stored Programs from Application Code | p. 270 |
Conclusion | p. 273 |
Using MySQL Stored Programs with PHP | p. 275 |
Options for Using MySQL with PHP | p. 276 |
Using PHP with the mysqli Extension | p. 276 |
Using MySQL with PHP Data Objects | p. 289 |
Conclusion | p. 308 |
Using MySQL Stored Programs with Java | p. 309 |
Review of JDBC Basics | p. 310 |
Using Stored Programs in JDBC | p. 317 |
Stored Programs and J2EE Applications | p. 323 |
Using Stored Procedures with Hibernate | p. 332 |
Using Stored Procedures with Spring | p. 337 |
Conclusion | p. 342 |
Using MySQL Stored Programs with Perl | p. 343 |
Review of Perl DBD::mysql Basics | p. 344 |
Executing Stored Programs with DBD::mysql | p. 354 |
Conclusion | p. 362 |
Using MySQL Stored Programs with Python | p. 364 |
Installing the MySQLdb Extension | p. 364 |
MySQLdb Basics | p. 365 |
Using Stored Programs with MySQLdb | p. 373 |
A Complete Example | p. 380 |
Conclusion | p. 385 |
Using MySQL Stored Programs with .NET | p. 386 |
Review of ADO.NET Basics | p. 386 |
Using Stored Programs in ADO.NET | p. 401 |
Using Stored Programs in ASP.NET | p. 413 |
Conclusion | p. 417 |
Optimizing Stored Programs | |
Stored Program Security | p. 421 |
Permissions Required for Stored Programs | p. 422 |
Execution Mode Options for Stored Programs | p. 423 |
Stored Programs and Code Injection | p. 434 |
Conclusion | p. 440 |
Tuning Stored Programs and Their SQL | p. 442 |
Why SQL Tuning Is So Important | p. 443 |
How MySQL Processes SQL | p. 445 |
SQL Tuning Statements and Practices | p. 449 |
About the Upcoming Examples | p. 459 |
Conclusion | p. 462 |
Basic SQL Tuning | p. 463 |
Tuning Table Access | p. 463 |
Tuning Joins | p. 480 |
Conclusion | p. 485 |
Advanced SQL Tuning | p. 486 |
Tuning Subqueries | p. 486 |
Tuning "Anti-Joins" Using Subqueries | p. 493 |
Tuning Subqueries in the From Clause | p. 495 |
Tuning Order and Group By | p. 501 |
Tuning DML (Insert, Update, Delete) | p. 503 |
Conclusion | p. 506 |
Optimizing Stored Program Code | p. 508 |
Performance Characteristics of Stored Programs | p. 508 |
How Fast Is the Stored Program Language? | p. 509 |
Reducing Network Traffic with Stored Programs | p. 512 |
Stored Programs as an Alternative to Expensive SQL | p. 515 |
Optimizing Loops | p. 519 |
If and Case Statements | p. 522 |
Recursion | p. 526 |
Cursors | p. 528 |
Trigger Overhead | p. 529 |
Conclusion | p. 532 |
Best Practices in MySQL Stored Program Development | p. 533 |
The Development Process | p. 533 |
Coding Style and Conventions | p. 539 |
Variables | p. 544 |
Conditional Logic | p. 551 |
Loop Processing | p. 555 |
Exception Handling | p. 559 |
SQL in Stored Programs | p. 562 |
Dynamic SQL | p. 566 |
Program Construction | p. 569 |
Performance | p. 577 |
Conclusion | p. 581 |
Index | p. 583 |
Table of Contents provided by Ingram. All Rights Reserved. |
ISBN: 9780596100896
ISBN-10: 0596100892
Series: O'Reilly Ser.
Published: 13th April 2006
Format: Paperback
Language: English
Number of Pages: 636
Audience: Professional and Scholarly
Publisher: O'Reilly Media, Inc, USA
Country of Publication: GB
Dimensions (cm): 23.3 x 18.0 x 3.4
Weight (kg): 1.04
Shipping
Standard Shipping | Express Shipping | |
---|---|---|
Metro postcodes: | $9.99 | $14.95 |
Regional postcodes: | $9.99 | $14.95 |
Rural postcodes: | $9.99 | $14.95 |
How to return your order
At Booktopia, we offer hassle-free returns in accordance with our returns policy. If you wish to return an item, please get in touch with Booktopia Customer Care.
Additional postage charges may be applicable.
Defective items
If there is a problem with any of the items received for your order then the Booktopia Customer Care team is ready to assist you.
For more info please visit our Help Centre.