Chapter 18. Stored Programs and Views

Table of Contents

18.1. Defining Stored Programs
18.2. Using Stored Routines (Procedures and Functions)
18.2.1. Stored Routine Syntax
18.2.2. Stored Routines and MySQL Privileges
18.2.3. Stored Routine Metadata
18.2.4. Stored Procedures, Functions, Triggers, andLAST_INSERT_ID()
18.3. Using Triggers
18.3.1. Trigger Syntax and Examples
18.3.2. Trigger Metadata
18.4. Using the Event Scheduler
18.4.1. Event Scheduler Overview
18.4.2. Event Scheduler Configuration
18.4.3. Event Syntax
18.4.4. Event Metadata
18.4.5. Event Scheduler Status
18.4.6. The Event Scheduler and MySQL Privileges
18.5. Using Views
18.5.1. View Syntax
18.5.2. View Processing Algorithms
18.5.3. Updatable and Insertable Views
18.5.4. View Metadata
18.6. Access Control for Stored Programs and Views
18.7. Binary Logging of Stored Programs

This chapter discusses stored programs and views, which are database objects defined in terms of SQL code that is stored on the server for later execution.

Stored programs include these objects:

Views are stored queries that when referenced produce a result set. A view acts as a virtual table.

This chapter describes how to use stored programs and views. The following sections provide additional information about SQL syntax for statements related to these objects:

In MySQL 5.7, metadata changes to objects referred to by stored programs are detected and cause automatic reparsing of the affected statements when the program is next executed. For more information, see Section 8.9.4, "Caching of Prepared Statements and Stored Programs". - all specs in one place