Chapter 19 Stored Programs and Views

Table of Contents

19.1 Defining Stored Programs
19.2 Using Stored Routines (Procedures and Functions)
19.2.1 Stored Routine Syntax
19.2.2 Stored Routines and MySQL Privileges
19.2.3 Stored Routine Metadata
19.2.4 Stored Procedures, Functions, Triggers, and LAST_INSERT_ID()
19.3 Using Triggers
19.3.1 Trigger Syntax and Examples
19.3.2 Trigger Metadata
19.4 Using the Event Scheduler
19.4.1 Event Scheduler Overview
19.4.2 Event Scheduler Configuration
19.4.3 Event Syntax
19.4.4 Event Metadata
19.4.5 Event Scheduler Status
19.4.6 The Event Scheduler and MySQL Privileges
19.5 Using Views
19.5.1 View Syntax
19.5.2 View Processing Algorithms
19.5.3 Updatable and Insertable Views
19.5.4 The View WITH CHECK OPTION Clause
19.5.5 View Metadata
19.6 Access Control for Stored Programs and Views
19.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: