PL/SQL tutorial 74: PL/SQL Bulk Collect Clause with FETCH-INTO statement of an explicit cursor

preview_player
Показать описание

------------------------------------------------------------------------
►►►LINKS◄◄◄

Previous Tutorial
-------------------------------------------------------------------------
►Make sure you SUBSCRIBE and be the 1st one to see my videos!
-------------------------------------------------------------------------
►►►Find me on Social Media◄◄◄
Follow What I am up to as it happens on

___Facebook Official Page of Manish Sharma___

For E-mail address please check the About section

Please please LIKE and SHARE my videos it makes me happy.

Thanks for liking, commenting, sharing and watching more of our videos

♥ I LOVE ALL MY VIEWERS AND SUBSCRIBERS
Рекомендации по теме
Комментарии
Автор

I don't get line 12. We bulk collect the records and fname.COUNT is 107. When exactly will the fname.COUNT be 0? Isn't fname.COUNT always 107 after the bulk collect and during the session? Also, why do we bulk collect the data inside the loop? Can't we just bulk collect it in a single shot like bulk collect is supposed to do?

ivanm
Автор

Thank you so much for the videos. I am starting my career as database developer and I find your videos highly useful.

mahasridhar
Автор

Thank you so much for your great work to share knowledge with no

learntolive
Автор

Ur my god .bcz of ur video only I could live n this word

mmohan
Автор

this works just as well:

DECLARE
CURSOR exp_cur IS
select first_name from hr.employees;

TYPE nt_fName IS TABLE OF VARCHAR(20);
fname nt_fName;
BEGIN
OPEN exp_cur;
FETCH exp_cur BULK COLLECT INTO fname;
FOR i IN fname.FIRST..fname.LAST
LOOP
dbms_output.put_line(i||' - '||fname(i));
END LOOP;
CLOSE exp_cur;
END;

ivanm
Автор

HI Mahish, Thanks for your nice tutorial. But is that required to create the outer loop ?? As per my understanding, if we are using bulk collect then automatically entire set of rows will be fetched( bulk collected) into PLSQL table variable ? Please correct me

akashdey
Автор

Why did you put Fetch statment inside the LOOP??? I kept it outside of loop, means w/o the loop, still working the same as when kept inside.

nikhilkhare
Автор

In this example, you have written Bulk collect inside the cursor Loop. It will execute 107 time but in the first time itself bulk collect fetch 107 time. How it works? Clarity me

dosspaul
Автор

In this exemple you used the nested table, Why when we used bulk collection it's not necessary to use the method extend?

DaniloOliveiracanal
Автор

if data is not more in a table then in that case will context switch happen or not??

saptanilchowdhury
Автор

Hi brother, I want print output first name and salary for 109 records it's possible or not possible.

Vikneshvikram
Автор

Manish what if the data present in table is not too long it's short. I mean what if there are not too many records like suppose only 6 records are present in employees table then in that case we need to use BULK COLLECT clause or it is of no use. ?? can u answer my question plz?? I have a doubt regarding this

saptanilchowdhury
Автор

one silly clarification needed,
since bulk collect will combine all the records in single chunk only, so why you have used Loop here. that first loop will always be execute only 1 time. ryte?

ganeshgupta
Автор

Great Sir... could you please provide a video for disadvantage of bulk collect

grsraja
Автор

Hi Manish sir, For printing when I write the 'FOR' statement after closing the cursor, its getting compiled but no output is coming . could you plz help me to understand. Thanks

laxminathdewangan
Автор

HELLO, I DON'T UNDERSTAND WHY YOU ENTER AS EXIT CONDITION FROM THE LOOP: EXIT WHEN FNAME.COUNT = 0.
IF YOU USE BULK TO POPULATE FNAME, IT SHOULD NEVER HAVE COUNT = 0 BECAUSE IT HAS JUST BEEN POPULATED.
THANKS AND CONGRATULATIONS FOR THE VIDEOS ;)

federicomino
Автор

Hello sir ...where we can find videos later than no. 74?

shashankdasaniya
Автор

sir, can you please tell how much videos are left for uploading so we can have a better idea of the things remaining.
thank you,
videos are awesome.

siddharthchaudhary
Автор

Manish using 1..collection. Count gives all the record on the same way can I use collection. First.. Collection. Last to get all the record if yes what is the diff

anilmohanty
Автор

why use loop while bulk collect .it store all values with out using loop

aleenshrestha