Welcome

PL SQL Tutorial


PL SQL BULK COLLECT INTO Clause

     PL/SQL BULK COLEECT clause fetches records from SQL engine in batches,rather than one at a time.

Syntax:
	      	BULK COLLECT INTO collection_name_list;
      	

PL SQL BULK COLLECT INTO clause can be used in SELECT INTO, FETCH INTO, or
RETURNING INTO clause of.

   DELETE Statement

   INSERT Statement

   UPDATE Statement

   EXECUTE IMMEDIATE Statement

Display table data using BULK Collect

declare
type emp_copy is TABLE OF employees%ROWTYPE;
l_emps emp_copy;
begin
select * bulk collect into l_emps from employees;
for idx in l_emps.FIRST..l_emps.LAST
loop
dbms_output.put_line(l_emps(idx).employee_id || ' '|| l_emps(idx).first_name);
end loop;
end;
	
	

ADS