Skip to main content

Pl/SQl program to retrieve data from table using Function


create or replace function totalemployees return number is
  total number(2) := 0;
Begin
  select count(*) into total from employee;

  return total;
end;

  --calling Function--

declare c number(2);
begin
c := totalemployees();
dbms_output.put_line('The total number of employees are :' || c);

end;

Comments