Write a procedure to return the month and the number of
developers joined in each month (cursor )
Answer Posted / rajesh venati
CREATE OR REPLACE PROCEDURE PRO
IS
CURSOR ECUR IS SELECT TO_CHAR(HIREDATE,'MON')
V_MONTH,COUNT(*) V_NO FROM EMP GROUP BY TO_CHAR(HIREDATE,'MON');
BEGIN
FOR V_ECUR IN ECUR LOOP
DBMS_OUTPUT.PUT_LINE(V_ECUR.V_MONTH||' '||V_ECUR.V_NO);
END LOOP;
END;
SQL> EXEC PRO;
DEC 3
APR 2
NOV 1
SEP 2
FEB 2
JUN 1
MAY 2
JAN 1
| Is This Answer Correct ? | 15 Yes | 3 No |
Post New Answer View All Answers
how to fetch alternate records from a table? : Sql dba
What are inner and outer joins examples of both?
What is an emotional trigger?
What is composite data type in pl sql?
What is the difference between the sql*loader and import utilities? : aql loader
What is cursor in pl sql?
What are the different parts of a package?
Define union, minus, union all, intersect ?
Can we use joins in subquery?
What is sql constant?
What plvcmt and plvrb does in pl/sql?
Why functions are used in sql?
How can you view the errors encountered in a trigger?
What is auto increment feature in sql?
What is full form of rtm?