Oracle PL/SQL Best Practices
Optimizing Oracle Code by Steven Feuerstein
Oracle PL/SQL Best Practices by Steven Feuerstein
Steven feuerstein is a guru of pl/sql, I remember attending a one day course at Oracle on PL/SQL and seeing Steven run through some amazing code on whiteboards and a laptop in record speed, he truely does seem to know everything about PL/SQL especially the DBMS_ packages.
The Oracle PL/SQL Best Practices book covers 120 of the best pl/sql practices split into nine categories, including: PL/SQL program development, coding style, data structures, control structures, exception handling, writing SQL in PL/SQL, program construction, package construction and built-in packages.
Working through the book you do see some excellent tips on how to smarten up your code, make it run faster and make it easier to read for fellow colleagues or yourself when you come back to the code in six months time.
Such coding tips include, never hard code varchar2 lengths, use %ROWTYPE and %TYPE whenever possible, removed unused variables from code and never fetch cursor records into a hard coded list of variables – always return them into cursor records. There are many more great tips like this in the pl/sql best practices book.
If you are about to embark on a new project of PL/SQL or need to re-work your code, or you are entering a new team and want to develop a new set of coding standards, then this book is well worth a read and is a great reference manual.
You will want to base your companies coding standards on the best practices in this book. You may not agree with all the examples in the book, and you may find some of the rules hard to stick to in the hectic everyday programming world, but a lot of the pl/sql best practices mentioned here are worth their weight in gold.