Showing posts with label for all. Show all posts
Showing posts with label for all. Show all posts

Mar 4, 2016

Bulk Processing in Oracle

 Bulk Processing with BULK COLLECT and FORALL


  • BULK COLLECT: SELECT statements that retrieve multiple rows with a single fetch, improving the speed of data retrieval


  • FORALL: INSERTs, UPDATEs, and DELETEs that use collections to change multiple rows of data very quickly


  • BULK COLLECT

    declare
      type t_plsql_type is table of employee%rowtype index by pls_integer;
      vt_plsql_type t_plsql_type;                      
    begin

       select * bulk collect into vt_plsql_type from  employee ;

       for v_typ_idx in 1..vt_plsql_type.count loop
           dbms_output.put_line(vt_plsql_type(v_typ_idx).emp_id);
       end loop;       

    end ;  

    FORALL