GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  PL/SQL
Go To First  |  Previous Question  |  Next Question 
 PL/SQL  |  Question 232 of 241    Print  
Retriving Multiple Records
Why PL/SQL does not support retriving multiple records?


  
Total Answers and Comments: 4 Last Update: September 14, 2009     Asked by: bmsrao 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
September 30, 2008 02:53:35   #1  
bijulalgs Member Since: September 2008   Contribution: 1    

RE: Retriving Multiple Records

If you want to retriving multiple records you can use Reference Cursor


 
Is this answer useful? Yes | No
October 01, 2008 07:05:04   #2  
netrasurve Member Since: January 2008   Contribution: 2    

RE: Retriving Multiple Records
In PL/SQL multiple records can be retrieved only through cursors.
 
Is this answer useful? Yes | No
November 04, 2008 17:57:25   #3  
Mad Hatter Member Since: November 2008   Contribution: 6    

RE: Retriving Multiple Records
Multiple records at a time could be retreved in PL/SQL using BULK COLLECT.
To do that you define PL/SQL table and load it using
SELECT ... BULK COLLECT INTO <pl/sql table>
FROM ..

Optionaly could be used LIMIT - to limit the number of records retreved at a time like

SELECT ... BULK COLLECT INTO <pl/sql table>
FROM ..
LIMIT 1000

 
Is this answer useful? Yes | No
September 13, 2009 13:51:45   #4  
promisinganuj Member Since: September 2009   Contribution: 3    

RE: Retriving Multiple Records

Retriving multiple records is a basic feature of SQL where we fetch the data using SELECT statement.
SELECT *
FROM emp;
This itself gives us multiple records. There is no additional feature required to do the same in PL/SQL.
At the same time PL/SQL goes one step further and enable us to process these fetched rows one by one (unlike the update statements which updates all the rows selected).
There are several options for fethcing data in different PL/SQL constructs:
1. Using Ordinary Cursor
2. Using Ref Cursor
3. Using PL/SQL bulk collect
4. Using PL/SQL arrays

But the important thing here is that irrespective of the way we fetch the data we act upon them row-by-row.


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape