用MySQL建了一个数据库,数据库中建了好几个存储过程,我希望这几个存储过程按照我所希望的顺序来执行,怎么设置?
call sp1('a',@returnvalue);
if @returnvalue is not null then call sp2('b');sp1没有返回值,这个直接执行不行,有完整的例子没有
call sp1('a',@returnvalue);
if @returnvalue is not null then call sp2('b');sp1没有返回值,这个直接执行不行,有完整的例子没有
没有这么设置的。但是你可以考虑这样,就是你再创建一个 总的存储过程,在这个存储过程里写上:call sp1('a',@returnvalue);
if @returnvalue is not null then call sp2('b');也就是说在这个总的存储过程里,按照你定义的顺序和处理逻辑,分别调用 sp1,sp2。
create event event_name
on schedule 定期执行时间
do call proc_name();