1、sqlserver,可以省略输出参数

--sqlserver调用存储过程,有输入参数,有输出参数

--省略输出参数
exec proc_GetReportPrintData 1, '', '', 1

--输出参数为 null
exec proc_GetReportPrintData 1, '', '', 1, null

--固定输出参数
exec proc_GetReportPrintData 1, '', '', 1, 'varchar'

--变量输出参数
declare @outValue varchar(100)
exec proc_GetReportPrintData 1, '', '', 1, @outValue

2、达梦,可以省略输出参数

--dm8调用存储过程,有输入参数,有输出参数

--省略输出参数
call proc_GetReportPrintData(1, '', '', 1);

--输出参数为 null
call proc_GetReportPrintData(1, '', '', 1, null);

--固定输出参数
call proc_GetReportPrintData(1, '', '', 1, 'varchar');

--变量输出参数
DECLARE
	outValue varchar(100);
begin
	call proc_GetReportPrintData(1, '', '', 1, outValue);
end;

3、mysql,不能省略输出参数

-- mysql调用存储过程,有输入参数,有输出参数

-- 变量输出参数
CALL proc_GetReportPrintData(1, '', '', 1, @outValue);

 

 

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐