create function sp_fun2 (spName varchar2) return
number is yearsal number(7,2);
begin
---执行部分
select sal*12+nvl(comm,0)*12 into yearSal from emp where ename= spName;
return yearsal;
end;
使用
var abc number; ---定义变量abc
call sp_fun2 ('SCOTT') into :abc; ---这里into:abc冒号后面不能有空格