create or replace function "F_BHM_HT_GETEMPID_BYLOG2"
(logname in VARCHAR2)
return NUMBER
is
l_empid number;
--l_count number;
begin
select a.id into l_empid from ESUN_EMP a where upper(a.logname)=upper(logname);
--select count(a.id) into l_count from ESUN_EMP a where upper(a.logname)=upper(logname);
return l_empid;
exception when no_data_found then return 0;
(logname in VARCHAR2)
return NUMBER
is
l_empid number;
--l_count number;
begin
select a.id into l_empid from ESUN_EMP a where upper(a.logname)=upper(logname);
--select count(a.id) into l_count from ESUN_EMP a where upper(a.logname)=upper(logname);
return l_empid;
exception when no_data_found then return 0;
end;
报错返回值超出请求行数,实际肯定只有一行,原因是函数的参数是Oracle保留字!!!
将logname 改成logname1 就没问题了
本文介绍了一个Oracle函数调试案例,该函数名为F_BHM_HT_GETEMPID_BYLOG2,用于通过用户名查询员工ID。调试过程中发现使用Oracle保留字作为参数名导致错误,并给出了修改建议。
691

被折叠的 条评论
为什么被折叠?



