您好,我有一个存储过程,参数如下所示:
CREATE PROCEDURE getModels
(
in :division char(2),
in :startdate date,
in :enddate date,
out :QualifyingModels int
);
...
我只是想测试一下out值是多少。当我创建一个新的SQL文档时,它似乎不想让我调用存储过程或声明变量来存储值。有没有一种简单的方法可以做到这一点?
由于
答案 0 :(得分:0)
编写另一个调用第一个过程并打印out参数的过程。像(未经测试)的东西:
CREATE PROCEDURE TestOutParam ()
BEGIN
DECLARE :division char(2);
DECLARE :startdate date;
DECLARE :enddate date;
DECLARE :QualifyingModels int;
SET :division ='AA';
SET :startdate = '2013-12-01';
set :enddate = '2013-12-04';
EXEC getModels (:division, :startdate date, :enddate date, :QualifyingModels);
PRINT :QualifyingModels;
END;