Skip to main content

Posts

Showing posts from February, 2022

bulk bind

 bulk collection when you delete a set of records that you wish to using a pl/sql program ,  oracle takes one empno number from pl/sql engine at a time to sql engine and executes it and comes back for the next one. If you have 100 such empno-records then oracle makes 100 such trips to pl/sql and sql engines. this trip between sql engine and pl/sql engine is called CONTEXT SWITCH. To ensure that only one context switch is made and not 100 or more we do the following: bulk bind the entire collection by using "FORALL syntax" to complete the job at one go. when oracle reads FORALL it understands that the entire collection of values are to be passed to the pl/sql engine for execution and not 100 context switches. Although the FORALL statement contains an  iteration scheme, it is not a FOR loop. wap to read all the records from emp table and load them to a new table emp_dup_tab, using bulk bind concept . create table emp_dup_table as select * from emp where 1=2; declare type dept_t