Answer Posted / swapna
CREATE OR REPLACE procedure emp_disp1(DNO EMP.DEPTNO%TYPE)
is
CURSOR CN(DNO1 NUMBER) IS SELECT * FROM EMP WHERE DEPTNO =
DNO;
CV CN%ROWTYPE;
begin
IF CN%ISOPEN THEN
DBMS_OUTPUT.PUT_LINE('CURSOR ALREADY OPEN');
ELSE
OPEN CN(DNO);
DBMS_OUTPUT.PUT_LINE('CURSOR OPEN NOW');
END IF;
FETCH CN INTO CV;
WHILE CN%FOUND LOOP
dbms_output.put_line('employee
id'||' '||CV.EMPNO||'employee
name'||' '||CV.Ename||'employee
managerid'||' '||CV.mgr||'employee
salary'||' '||CV.sal||'eEMPLOYEE DEPT
ID'||CV.DEPTNO);
FETCH CN INTO CV;
END LOOP;
DBMS_OUTPUT.PUT_LINE('NUMBER OF FETCHES IS '||CN%ROWCOUNT);
CLOSE CN;
exception
when no_data_found then
dbms_output.put_line('record not existed');
when too_many_rows then
dbms_output.put_line('record not existed');
end;
/
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is normalization in sql?
What is identity column in sql server?
what is 'mysqlshow'? : Sql dba
What is the difference between sum and count in sql?
How to display the current date in sql?
how to load data files into tables with 'mysqlimport'? : Sql dba
What is fmtonly in sql?
Can %notfound return null after a fetch?
Are there any features that are decommissioned in 11g that are not present in 11g?
define sql insert statement ? : Sql dba
What is varray in pl sql?
Which function is used to return remainder in a division operator in sql?
How do I remove all records from a table?
What are the two types of exceptions in pl/sql?
What does count (*) mean?