sql代码:
delimiter //
create function fun_proId($detailInvNO Varchar(20),$detailTypeCode Varchar(20), $detailInvKind char(1), $detailInvMachineNo varchar(10))
returns int
begin
declare $proId int;
select $proId = id from InvInfos where invNO = $detailInvNO and invTypeCode = $detailTypeCode
and invKind = $detailInvKind and invMachineNo = $detailInvMachineNo;
if ISNULL($proId) then
set $proId = 0;
end if;
return $proId;
end;//
delimiter ;报错信息:
Error Code : 1415
Not allowed to return a result set from a function
(0 ms taken)
谢谢! 我今天第一次用mysql 帮帮忙啊!
delimiter //
create function fun_proId($detailInvNO Varchar(20),$detailTypeCode Varchar(20), $detailInvKind char(1), $detailInvMachineNo varchar(10))
returns int
begin
declare $proId int;
select $proId = id from InvInfos where invNO = $detailInvNO and invTypeCode = $detailTypeCode
and invKind = $detailInvKind and invMachineNo = $detailInvMachineNo;
if ISNULL($proId) then
set $proId = 0;
end if;
return $proId;
end;//
delimiter ;报错信息:
Error Code : 1415
Not allowed to return a result set from a function
(0 ms taken)
谢谢! 我今天第一次用mysql 帮帮忙啊!
写 函数和触发器也是这样的。
select 返回的若是结果集,就都不行。
我最近写触发器,也老师碰到这个问题,恼火死!