我在 oracle 中创建了函数,我注意到它没有返回任何内容/空字符串。
甲骨文功能
CREATE OR REPLACE function UDF_GET_STATUS(P_ID in NUMBER)
return NVARCHAR2 is
l_status NVARCHAR2(25);
begin
select case
when exists(select ID, STATUS
from Transaction
where ID = P_ID AND STATUS = 1)
then 'APPROVED'
else 'FOR APPROVAL'
end into l_status
from Transaction WHERE ID = P_ID;
return l_status;
end;
我错过了什么吗?请指教..
谢谢,