mysql调试存储过程的方法:首先用一张临时表,记录调试过程;然后直接在存储过程中,增加【select @xxx】,并在控制台查看结果即可。
【相关学习推荐:mysql学习】
mysql调试存储过程的方法:
在navicat中调用存储过程
1. 写语句调用
call p_next_id('t_factory',2,'0',@result); -- 上面的存储过程含有四个参数,所以这里调用的时候,也需要传递4个参数:输入参数填写值,输出参数用变量表示@resultselect @result; -- 这句话是在控制台显示变量值2. 窗口点击
直接点击运行时,在弹出输入框输入:
't_factory',2,'0',@result追踪存储过程执行步骤
mysql不像oracle有plsqldevelper工具用来调试存储过程,所以有两简单的方式追踪执行过程:
用一张临时表,记录调试过程
直接在存储过程中,增加select @xxx,在控制台查看结果:
例如我把上面的存储过程中加一些查询语句(注意下面的红色语句)
create procedure `p_next_id`(kind_name varchar(30), i_length int,currentseqno varchar(3),out o_result int)begin set @a= null; set @b= null; select id into @a from t_seq where number= currentseqno and length= i_length ; select @a; if (@a is null ) then select min(id) into @a from t_seq where length = i_length; select number into @b from t_seq where id = @a; select @b; else select number into @b from t_seq where id = @a 1; end if; select @b into o_result; end
阿里云轻服务器多收费用百度云服务器搭建网站asf是什么格式的文件 asf格式怎么打开运维堡垒机好用吗更换服务器影响seo吗 一般更换服务器要注意哪些请问这个退信内容是什么意思云服务器与固态硬盘java打印输出语句是什么?