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 top in tsql? : Transact sql
What is sql profiler in oracle?
How do you explain an index?
What are three advantages to using sql?
Does postgresql run on the cloud?
What is sql character function?
What are field types?
what are the system privileges that are required by a schema owner (user) to create a trigger on a table?
How can I make sql query run faster?
Explain the the delete statements in sql?
What is constant in pl sql?
How to add new employee details in an employee_details table with the following details
what is an extent ? : Sql dba
What are sql functions? Describe in brief different types of sql functions?
Can you skip header records while loading? : aql loader