函数:
create or replace function sal_fun
(no in number)
return number is
newSal number;
begin
select sal into newSal
from new_Sal where empno=no;
return(newSal);
end sal_fun;
调用:
update emp set sal = sal_fun(empno)【问题在这里】
where empno in(select empno from emp);
我以emp表为例,业务是把emp表所有员工的sal更新成newSal
请问我在调用那一块要如何写?
如何在update中调用自定义函数,并把where 字句的参数传进去?