DeptNOCountEmp - having deptno=dno emprec number(5) begin...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 --finding the count of employees for each department create or replace function count_emp (dno in emp.deptno%type) return varchar2 is cursor c1 is select count(empno) tot from emp group by deptno
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: having deptno=dno emprec number(5) begin open c1 fetch c1 into emprec if c1%notfound then return 'no such department' else return emprec end if end /...
View Full Document

Ask a homework question - tutors are online