Lab 6 PL-SQL-Procedure
Lab 6 PL-SQL-Procedure
delimiter $$
drop procedure if exists display$$
create procedure display()
begin
select "My first program" as "Output";
end $$
delimiter ;
• When you write an individual statement you will need only a semicolon at the end
of the statement.
• But what if you want to write a block of statements that works as a single unit? In
that case, you will need to change the delimiter.
• In MySQL, stored procedures, functions and triggers are the blocks of statements
where you need the delimiter other than the default semicolon. The delimiter helps
MySQL to acknowledge the group of statements as a single unit or single task.
However, the individual statements in the blocks end with semicolons.
• If you are considering multiple statements, then you need to use different
delimiters like $$ or //.