MySQL – Stored Procedures Introduction

Stored Procedures allow you to write and call full SQL Statements just like scripts in an operating system.

Create Procedure:

delimiter $$

create procedure procedureName()
   select * from table;

delimiter ;
  • delimiter $$ or delimiter ; – sets delimiter
  • call procedureName; – calls procedure
  • show procedure status where db=’databaseName’; – shows procedures in database
  • show create procedure procedureName; – shows how procedure was created
  • drop procedure procedureName; – deletes procedure

Be the first to comment

Leave a Reply