MySQL Stored Procedure Programming

First Edition April 2006
ISBN 978-0-596-10089-6
Seiten 636
EUR43.00, SFR71.90


Weitere Informationen zu diesem Buch

Inhaltsverzeichnis | Index | Probekapitel | Kolophon | Rezensionen |


Inhaltsverzeichnis

	

Preface

Part I. Stored Programming Fundamentals

1. Introduction to MySQL Stored Programs
     What Is a Stored Program?
     A Quick Tour
     Resources for Developers Using Stored Programs
     Some Words of Advice for Developers
     Conclusion

2. MySQL Stored Programming Tutorial
     What You Will Need
     Our First Stored Procedure
     Variables
     Parameters
     Conditional Execution
     Loops
     Dealing with Errors
     Interacting with the Database
     Calling Stored Programs from Stored Programs
     Putting It All Together
     Stored Functions
     Triggers
     Calling a Stored Procedure from PHP
     Conclusion

3. Language Fundamentals
     Variables, Literals, Parameters, and Comments
     Operators
     Expressions
     Built-in Functions
     Data Types
     MySQL 5 "Strict" Mode
     Conclusion

4. Blocks, Conditional Statements, and Iterative Programming
     Block Structure of Stored Programs
     Conditional Control
     Iterative Processing with Loops
     Conclusion

5. Using SQL in Stored Programming
     Using Non-SELECT SQL in Stored Programs
     Using SELECT Statements with an INTO Clause
     Creating and Using Cursors
     Using Unbounded SELECT Statements
     Performing Dynamic SQL with Prepared Statements
     Handling SQL Errors: A Preview
     Conclusion

6. Error Handling
     Introduction to Error Handling
     Condition Handlers
     Named Conditions
     Missing SQL:2003 Features
     Putting It All Together
     Handling Stored Program Errors in the Calling Application
     Conclusion

Part II. Stored Program Construction

7. Creating and Maintaining Stored Programs
     Creating Stored Programs
     Editing an Existing Stored Program
     SQL Statements for Managing Stored Programs
     Getting Information About Stored Programs
     Conclusion

8. Transaction Management
     Transactional Support in MySQL
     Defining a Transaction
     Working with Savepoints
     Transactions and Locks
     Transaction Design Guidelines
     Conclusion

9. MySQL Built-in Functions
     String Functions
     Numeric Functions
     Date and Time Functions
     Other Functions
     Conclusion

10. Stored Functions
     Creating Stored Functions
     SQL Statements in Stored Functions
     Calling Stored Functions
     Using Stored Functions in SQL
     Conclusion

11. Triggers
     Creating Triggers
     Using Triggers
     Trigger Overhead
     Conclusion

Part III. Using MySQL Stored Programs in Applications

12. Using MySQL Stored Programs in Applications
     The Pros and Cons of Stored Programs in Modern Applications
     Advantages of Stored Programs
     Disadvantages of Stored Programs
     Calling Stored Programs from Application Code
     Conclusion

13. Using MySQL Stored Programs with PHP
     Options for Using MySQL with PHP
     Using PHP with the mysqli Extension
     Using MySQL with PHP Data Objects
     Conclusion

14. Using MySQL Stored Programs with Java
     Review of JDBC Basics
     Using Stored Programs in JDBC
     Stored Programs and J2EE Applications
     Using Stored Procedures with Hibernate
     Using Stored Procedures with Spring
     Conclusion

15. Using MySQL Stored Programs with Perl
     Review of Perl DBD::mysql Basics
     Executing Stored Programs with DBD::mysql
     Conclusion

16. Using MySQL Stored Programs with Python
     Installing the MySQLdb Extension
     MySQLdb Basics
     Using Stored Programs with MySQLdb
     A Complete Example
     Conclusion

17. Using MySQL Stored Programs with .NET
     Review of ADO.NET Basics
     Using Stored Programs in ADO.NET
     Using Stored Programs in ASP.NET
     Conclusion

Part IV. Optimizing Stored Programs

18. Stored Program Security
     Permissions Required for Stored Programs
     Execution Mode Options for Stored Programs
     Stored Programs and Code Injection
     Conclusion

19. Tuning Stored Programs and Their SQL
     Why SQL Tuning Is So Important
     How MySQL Processes SQL
     SQL Tuning Statements and Practices
     About the Upcoming Examples
     Conclusion

20. Basic SQL Tuning
     Tuning Table Access
     Tuning Joins
     Conclusion

21. Advanced SQL Tuning
     Tuning Subqueries
      Tuning "Anti-Joins" Using Subqueries
     Tuning Subqueries in the FROM Clause
     Tuning ORDER and GROUP BY
     Tuning DML (INSERT, UPDATE, DELETE)
     Conclusion

22. Optimizing Stored Program Code
     Performance Characteristics of Stored Programs
     How Fast Is the Stored Program Language?
     Reducing Network Traffic with Stored Programs
     Stored Programs as an Alternative to Expensive SQL
     Optimizing Loops
     IF and CASE Statements
     Recursion
     Cursors
     Trigger Overhead
     Conclusion

23. Best Practices in MySQL Stored Program Development
     The Development Process
     Coding Style and Conventions
     Variables
     Conditional Logic
     Loop Processing
     Exception Handling
     SQL in Stored Programs
     Dynamic SQL
     Program Construction
     Performance
     Conclusion

Index


Zurück zu MySQL Stored Procedure Programming


Themen

Buchreihen

Special Interest

International Sites

O'Reilly China O'Reilly France O'Reilly USA O'Reilly Japan O'Reilly Taiwan