mysql基础之存储过程

1.建立存储过程(begin和end之间可以写增删改查语句

-- 建立存储过程
delimiter $$
create procedure p_show()
begin
    select id ,name from teacher;
end $$;
delimiter ;

 2.调用过程


-- 调用执行过程
call p_show();

3.查看存储过程


-- 查看存储过程
show procedure status where Db=database();

4.删除存储过程


-- 删除存储过程
drop procedure if exists p_show;

这就是存储过程的基本应用啦!!!

你可能感兴趣的:(mysql,数据库)