create or replace function change_sal (p_job varchar2) return number as v_result number(7,2) ; begin if p_job = ‘CLERK‘ then v_result := 0.1 ; elsif p_job = ‘SALESMAN‘ then v_result := 0.15 ; elsif p_job = ‘MANAGER‘ then v_result := 0.2 ; end if; return v_result ; end; declare result number(7,2) := 0 ; begin result := change_sal(‘CLERK‘); DBMS_OUTPUT.PUTON(‘0‘||result); end; |
时间: 2024-10-07 05:51:09