plsql - Which is best loop to fetch data from a Cusor in Oracle PL/SQL? -


i learning oracle pl/sql. want know loop best fetching data cursor. , please tell me when should use loop best performance.

i rather avoid using explicit cursor , use cursor loop.

for example,

begin   in   (select column_list table   )   loop     <do something>   end loop; end; / 

remember, loop row-by-row a.k.a. slow-by-slow.

also, there reason why cursor loop better on explicit cursor. in recent oracle versions, optimized in better way doing bulk collect limit 100 internally.

but, it's not bulk collecting, dealing operations subsequently on array have fetched incrementally. further improve performance using forall statement along bulk collect.

imo, if possible, in pure sql. because, sql , pl/sql 2 different engines. procedural code handled pl/sql engine while sql handled sql statement executor, or sql engine. there overhead associated each context switch between 2 engines. so, if possible avoid context switching doing in pure sql.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -