定义不带参数的存储过程
CREATE PROCEDURE s1()
BEGIN
select * from ecs_admin_action;
End
call s1;
2.带输入参数的
create PROCEDURE s2(in id int)
BEGIN
select * from ecs_admin_action where action_id=id;
END
set @id=3;
call s2(@id);
3.带输出参数
create PROCEDURE s3 (out a varchar(20))
BEGIN
select action_code into a from ecs_admin_action where action_id=3;
END
set @a='';
call s2(@a);
select @a;