【发布时间】:2013-08-07 19:20:05
【问题描述】:
我正在尝试调试此问题。我已经走极端了,我只是想弄清楚为什么即使 return var 明确设置为某个值,MySQL 也会返回 null。
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`(
OUT numberExpectedToFill int(11))
DETERMINISTIC
BEGIN
set numberExpectedToFill := 23;
commit;
END
所以,我编写了一个小脚本来调用它,返回值为 NULL。为什么?
prepare s from 'call `test_schema`.`foo`(@output)';
execute s;
select @output
【问题讨论】:
标签: mysql stored-procedures null return-value