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
what is normalization? : Sql dba
What are some emotional triggers?
What are the advantages of indexing?
can sql servers linked to other servers like oracle? : Sql dba
What is a sql select statement?
Why do we need unique key in a table?
Explain the advantages and disadvantages of stored procedure?
What is a parameter query?
Which column of the user triggers data dictionary view displays the database event that will fire the trigger?
How to prepare for oracle pl sql certification?
What are operators available in sql?
What is on delete restrict?
What is procedure explain with example?
What are pl/sql packages?
What is varray in pl sql?