17,086
社区成员
发帖
与我相关
我的任务
分享
create or replace function get_salary(
dept_no number)
return number is
v_sum number;
emp_count NUMBER;
begin
select sum(salary),count(*) into v_sum, emp_count
from employees where employees_id > dept_no;
return v_sum;
exception
when no_data_found then
dbms_output.put_line('the date you need is not exist');
when too_many_rows then
dbms_output.put_line('program error,please use cousor');
when others then
dbms_output.put_line('other errors');
end get_salary;