Skip to main content

PL/SQL Programming Tips/Code Tuning

Things to remember while writing PL/SQL code:
  • Always write a optimized Code.Some might think it is optimized based on length of the code. But one should take care that optimized  code does not depend on how small or big are the lines of code,but it all depends of the performance of the code snippet. 
  • The performance can be considered based on the execution time it takes. The more minimum time taken is the well performed program.
  • Below are some code tuning tip,
      1)Always prefer >=,<= rather than using BETWEEN function

      2)If NULL conditions are need to be checked in IF blocks, always use IS NULL in IF clause, rather than using IS NOT NULL in IF clause. Because performing NOT function take some amount of execution time.

          Eg: 1)IF var1 IS NULL  THEN                      2) IF var1 IS NOT NULL THEN                
                    ------------                                                   -----------------------
                   ELSE                                                         ELSE
                    -------------                                                -------------------------
                    END IF;                                                   END IF;
         
         In the above examples, eg1 performs faster than eg2

      3)Do not use COMMIT in any loops of PL/SQL coding unless each record needs to be committed at that instance,
  •  For example if there are 100 records and all of them needs to be committed when all of them    are  valid only. In that case we can write the COMMIT outside the LOOP. 
  •  Because  COMMIT will consume some time to perform that operation for each record. 
  •  And if the requirement is like we need to store each record immediately and skip the INVALID  record we can use COMMIT inside. Use it based on the requirement given.

Comments

Popular posts from this blog

VMRDA, RERA Approved Plots At Visakhapatnam, Vizianagaram, Rajmundry And Hyderabad.

 VMRDA, RERA Approved Plots At Visakhapatnam, Vizianagaram, Rajmundry And Hyderabad -  Contact - Phone - Whatsapp - 8050797018 Plots at kothavalsa, visakhapatnam -  This comes at low cost area around visakhapatnam, which comes after pendurthi which can be said as end of city. If you want to invest at low cost with high returns, one can invest here. This is next development area in visakhapatnam as it is outskirts of city.  Plots At Ainada, Chintalavalsa, Vizianagaram - This is near to vizianagaram city. There are engineering college's, schools, malls, atm, etc around this area by 3 km. As place is centre and near to vizianagaram city and on road to next visakhapatnam, one can easily invest here for low cost and higher returns also.  Plots At Konada, Bhogapuram, Vizianagaram -  This area is next centre development area due to international airport which is started construction and can be done in 3 years. Engineering college's, schools, shops are very near, more over best place w

Diwali 2023 Top 10 Picks, Stock Market India

 Hold for atleast 1-2 years for good returns. These are basing on many fundamental parameters.  Ircon intl Natco pharma Karur vysya Aegis logistics Gsfc Marksans pharma Surya roshni Share india Shriram pistons Sundaram finance Disclaimer - Only for education purpose, contact your advisor. Contact 8050797018 for any query. 

Nifty Banknifty July 1st And Week, Analysis, Direction, Levels, Stock Market India - News009

 Nifty July 1st And Week, Analysis, Direction, Levels, Stock Market India - News009 Nifty is in bullish trend (upside). Buy on dip like trend, 18800, 400 forms strong support, Daily closing below 18400 for 3 days trend can change to sell on rise (downside) Next selling days  - 5th and 12th,13th are selling dates basing on mathematics and market geometry. Observed selling pressure on most of days even daily closing is flat or positive.  Levels for coming week - More accurate on 15 min closing. Red and Green are major strong levels Banknifty closed all time high and in bullish trend. 43850, 43350 forms strong support. Daily closing below 43350 for 3 days trend can change to sell on rise, downside.  Levels for coming week  - More accurate on 15 min closing. Red and Green are major strong levels Disclaimer - Only for education purpose, contact your advisor. Any Query - Contact Prakash - 8050797018, Telegram - Stock market trading training. OPEN FREE UPSTOX TRADING DMAT ACCOUNT HERE Click