📅  最后修改于: 2022-03-11 15:05:31.699000             🧑  作者: Mango
DECLARE
em_sal NUMBER(20);
em_comm employees.commission_pct%type;
annual_salary NUMBER(10,4);
BEGIN
SELECT salary INTO em_sal FROM employees WHERE employee_id=149;
SELECT commission_pct INTO em_comm FROM employees WHERE employee_id=149;
annual_salary := get_annual_comp(em_sal,em_comm);
dbms_output.put_line('total salary '|| annual_salary);
SELECT SUM(get_annual_comp(salary,commission_pct)) into annual_salary
FROM employees
WHERE department_id=90;
dbms_output.put_line('department annual salary '|| annual_salary);
END;
/