Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

how to fetch alternate records from a table? : Sql dba

1060


What are inner and outer joins examples of both?

895


What is an emotional trigger?

940


What is composite data type in pl sql?

1046


What is the difference between the sql*loader and import utilities? : aql loader

992


What is cursor in pl sql?

1061


What are the different parts of a package?

1053


Define union, minus, union all, intersect ?

957


Can we use joins in subquery?

1094


What is sql constant?

955


What plvcmt and plvrb does in pl/sql?

1255


Why functions are used in sql?

944


How can you view the errors encountered in a trigger?

922


What is auto increment feature in sql?

1076


What is full form of rtm?

965