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
Where is pl sql used?
what is offset-fetch filter in tsql? : Transact sql
How to rename a table?
What is aggregate function in sql?
Mention what are the benefits of pl/sql packages?
What is a sql profiler?
What is the difference between microsoft access and sql server?
what is datawarehouse? : Sql dba
Which are the different character-manipulation functions in sql?
How to run sql*plus commands in sql developer?
Why sql query is slow?
What pl/sql package consists of?
What view means?
What are the properties of a transaction?
Is record in oracle pl sql?