CURSOR FOR LOOP [message #617378] |
Fri, 27 June 2014 20:30 |
manubatham20
Messages: 566 Registered: September 2010 Location: Seattle, WA, USA
|
Senior Member |
|
|
Hi,
I got some very basic doubt about CURSOR FOR LOOP, but got no reference of it how internally fetches rows.
Does it
1. Fetch all the rows at once, and stores it and may cause memory problem if data is very big?
2. Fetch row by row as required and execute statements inside body?
3. May fetch a chunk of records, and internally may usage bulk_collect to limit number of rows?
I think it's either 2, or 3 depending on the situation, can anyone please refer me to some manual, as I tried but was not able to find any reference.
Thanks,
Manu
|
|
|
|
|
|
Re: CURSOR FOR LOOP [message #617505 is a reply to message #617389] |
Mon, 30 June 2014 21:46 |
manubatham20
Messages: 566 Registered: September 2010 Location: Seattle, WA, USA
|
Senior Member |
|
|
That's fine BlackSwan, I was aware that it fetches 1 by 1 row at a time, and 10g/11g simulates bulk collect functionality internally up to some extent.
Because I was fetching from very large table, and if it fetches all the data same time and store it somewhere, then it will be problem.
But someone was too confident, that I have to check my knowledge again.
Lalit, appreciate your help. I read the same information on
http://www.oracle.com/technetwork/issue-archive/2008/08-nov/o68plsql-088608.html
and
http://www.oracle.com/technetwork/issue-archive/2013/13-mar/o23plsql-1906474.html
Thanks Michel, that's exactly what I needed to know.
Manu
[Updated on: Mon, 30 June 2014 21:48] Report message to a moderator
|
|
|