MySQL stored procedure programming
The implementation of stored procedures in MySQL 5.0 a hugemilestone -- one that is expected to lead to widespread enterprise adoption ofthe already extremely popular MySQL database. If you are serious aboutbuilding the web-based database applications of the future, you need toget up to speed quick...
Autor principal: | |
---|---|
Otros Autores: | |
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Beijing ; Sebastopol, California :
O'Reilly
2006.
|
Edición: | First edition |
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009627216306719 |
Tabla de Contenidos:
- Table of Contents; Preface; Objectives of This Book; Structure of This Book; What This Book Does Not Cover; Conventions Used in This Book; Which Version?; Resources Available at the Book's Web Site; Using Code Examples; Safari® Enabled; How to Contact Us; Acknowledgments; Part I; Introduction to MySQL Stored Programs; What Is a Stored Program?; Why Use Stored Programs?; A Brief History of MySQL; MySQL Stored Procedures, Functions, and Triggers; A Quick Tour; Integration with SQL; Control and Conditional Logic; Stored Functions; When Things Go Wrong; Triggers
- Resources for Developers Using Stored ProgramsBooks; Internet Resources; Some Words of Advice for Developers; Don't Be in Such a Hurry!; Don't Be Afraid to Ask for Help; Take a Creative, Even Radical Approach; Conclusion; MySQL Stored Programming Tutorial; What You Will Need; Our First Stored Procedure; Creating the Procedure; Creating the Procedure Using the MySQL Query Browser; Variables; Parameters; Parameter Modes; Conditional Execution; Loops; Dealing with Errors; Interacting with the Database; SELECTing INTO Local Variables; Using Cursors; Returning Result Sets from Stored Procedures
- Embedding Non-SELECTsCalling Stored Programs from Stored Programs; Putting It All Together; Stored Functions; Triggers; Calling a Stored Procedure from PHP; Conclusion; Language Fundamentals; Variables, Literals, Parameters, and Comments; Variables; Literals; Rules for Variable Names; Assigning Values to Variables; Parameters; User Variables; Comments; Operators; Mathematical Operators; Comparison Operators; Logical Operators; Bitwise Operators; Expressions; Built-in Functions; Data Types; String Data Types; The ENUM data type; The SET data type; Numeric Data Types; Date and Time Data Types
- TEXT and BLOB Data TypesMySQL 5 "Strict" Mode; Stored Program Behavior and Strict Mode; Program Examples; Conclusion; Blocks, Conditional Statements, and Iterative Programming; Block Structure of Stored Programs; Structure of a Block; Nested Blocks; Conditional Control; The IF Statement; TRUE or FALSE (or neither)?; Simple IF-THEN combinations; IF-THEN-ELSE statements; IF-THEN-ELSEIF-ELSE statements; The CASE Statement; Simple CASE statement; "Searched" CASE statement; IF Versus CASE; Iterative Processing with Loops; LOOP Statement; LEAVE Statement; ITERATE Statement; REPEAT ... UNTIL Loop
- WHILE LoopNested Loops; Parting Comments on Loops; Conclusion; Using SQL in Stored Programming; Using Non-SELECT SQL in Stored Programs; Using SELECT Statements with an INTO Clause; Creating and Using Cursors; Defining a Cursor; Cursor Statements; Fetching a Single Row from a Cursor; Fetching an Entire Result Set; Types of Cursor Loops; Nested Cursor Loops; Exiting the Cursor Loop Prematurely; Cursor Error Conditions; Using Unbounded SELECT Statements; Retrieving the Result Sets in the Calling Program; Returning Result Sets to Another Stored Procedure
- Performing Dynamic SQL with Prepared Statements