Creating a stored procedure


show more Creating a stored procedure provides you with in-depth training on Developer. Taught by Bill Weinman as part of the MySQL Essential Training show less
please wait ...

Creating a stored procedure

A stored procedure is defined with the create procedure statement. For this lesson I'm going to use the album database. And we're going to start by creating a simple procedure. Now, a procedure may have multiple lines in it. And these multiple lines may be delimited with semicolons. And in order for that entire block of. Text. That entire block of code to be sent to the server all at once. We need to actually change the delimiter for a short time, temporarily, to something else, so that that entire block can be sent to the server as a unit.

So that looks like this. I use the DELIMITER command. And I changed delimiter to something other than a semicolon like that. I'll change it back when we're done and then, I type CREATE PROCEDURE and I name the procedure and I have BEGIN and END and, after the end, I put in that double-slash and then, this entire block along with the statements. I'm just going to put in a SELECT statement here for now. That entire block from create procedure all th...

Creating a stored procedure
Video duration: 5m 52s 4h 24m Beginner

Viewers:

Creating a stored procedure provides you with in-depth training on Developer. Taught by Bill Weinman as part of the MySQL Essential Training

Subject:
Developer
Software:
MySQL
Author:
please wait ...