/*
利用存储函数,查询某个员工的年薪
sal*12+ nvl(comm)
*/
create or replace function queryEmp(eno in number)
return NUMBER
as
psal emp.sal% TYPE;
pcomm emp.comm% TYPE;
begin
select sal,comm into psal,pcomm from emp where empno=eno;
--计算返回
return psal*12 + nvl(pcomm,0);
end;
/