Quote:
Originally Posted by Kohilavani
Also help to tune this code..
|
Don't use PL/SQL. Use straight, single SQL query.
Your code actually performs a simple join of three table, but in the most ineffective way,
fetching row by row from the first cursor c1, then for each row from c1 opening, fetching (row by row) and closing the second cursor c2, and then the same with third cursor c3.
Row by row = slow by slow.
Remember that fetching each row from the cursor in PL/SQL code requires context switch between sql and pl/sql engines, and that is very costly ( open google and search for "pl/sql context swich").
Combine your 3 cursors into one SQL query, this is the most effective way.