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?

Answers were Sorted based on User's Feedback



what is ref cursor in pl/sql?..

Answer / 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

what is ref cursor in pl/sql?..

Answer / swapna

A Reference Cursor is majorly used when we want to execute
a dynamic select statement causes to retrieve more than
one record. We can pass Reference cursor result as a out
parameter which can be used in other sub programs.

Is This Answer Correct ?    27 Yes 7 No

what is ref cursor in pl/sql?..

Answer / suresh kumar somayajula

Re-usability of a cursor is nothing but " REF CURSOR".
It is of 2 types.
1. Weak REF Cursor
2. Strong REF Cursor.

SYNTAX:
1.Strong Refcursor
SYN: TYPE <TYPE_NAME> IS
REFCURSOR RETURN <RETURN_DATA_TYPE>
2.Weak Refcursor
SYN : TYPE <TYPE_NAME> IS
REFCURSOR

Thank you,
Suresh

Is This Answer Correct ?    11 Yes 2 No

Post New Answer

More SQL PLSQL Interview Questions

What is ON DELETE CASCADE?

3 Answers  


How many types of index are there?

0 Answers  


write a procedure to print a statement or number not using "dbms_output.put_line" package.write a procedure instead of it using procdure name as "print" ex:- declare a number:=2; begin print(a); end; /* when U type above procedure 2 have to should be printed*/

2 Answers   iFlex,


Describe types of sql statements?

0 Answers  


what is the difference between delete and truncate statement in sql? : Sql dba

0 Answers  


What are pl sql procedures?

0 Answers  


What is the use of prepared statement?

0 Answers  


What is dml with example?

0 Answers  


cursor types? explain with example programs?

1 Answers   HP,


Can we use ddl statements in stored procedure?

0 Answers  


column A column b | output 10 7 | 10 5 8 | 8 7 -9 | 7 3 5 | 5 0 6 | 6 Write a sql query to print such output.

4 Answers  


what is data integrity

3 Answers   Fidelity, TCS,


Categories