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...

what is ref cursor in pl/sql?

Answer Posted / hitendra yadav

Reference cursor is as like pointer in C ad PASCAL language
which is point the data's memory location,REF CURSOR is
dynamic cursor which can be open for more then one query.
there are two type of ref cursof:-
(1) WEEK REF CURSOR:- ref cursor which not have return
cluse in defination.
(2) STRONG REF CURSOR :- ref cursor which use return cluse
in defination.

for example:-

SET serveroutput ON
DECLAR
TYPE eref REF CURSOR; -- WEEK REF CURSOR
eref1 eref;
erec employees%ROWTYPE;
BEGIN
OPEN eref1 FOR SELECT *
FROM employees
WHERE dept_id=90;
LOOP
FETCH eref1
INTO erec;
DBMS_OUTPUT.PUT_LINE(erec.emp_id);
EXIT WHEN eref1%NOTFOUND;
END LOOP;
END;

Is This Answer Correct ?    30 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is denormalization in a database?

1053


Why stored procedure is better than query?

946


What is a boolean in sql?

980


What is data manipulation language?

1187


explain normalization concept? : Sql dba

1045


how can we repair a mysql table? : Sql dba

979


how to use myisamchk to check or repair myisam tables? : Sql dba

971


How do I run a sql script?

1147


How can you save or place your msg in a table?

1001


What does fetching a cursor do?

1087


Can you skip header records while loading? : aql loader

1053


what is the difference between delete and truncate commands? : Sql dba

1068


How to look at the current sql*plus system settings?

1149


what is the difference between a local and a global temporary table? : Sql dba

1073


Can we commit in trigger?

976