Oracle PL/SQL best practices optimizing Oracle code

In this book, Steven Feuerstein, widely recognized as one of the world's experts on the Oracle PL/SQL language, distills his many years of programming, writing, and teaching about PL/SQL into a set of PL/SQL language ""best practices""--rules for writing code that is readab...

Descripción completa

Detalles Bibliográficos
Autor principal: Feuerstein, Steven (-)
Formato: Libro electrónico
Idioma:Inglés
Publicado: Sebastopol, California : O'Reilly 2001.
Edición:First edition
Materias:
Ver en Biblioteca Universitat Ramon Llull:https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009627221306719
Tabla de Contenidos:
  • Table of Contents; Preface; Structure of This Book; How to Use This Book; Not All Best Practices Are Created Equal; About the Code; Other Resources; Conventions Used in This Book; Comments and Questions; Acknowledgments; The Development Process; DEV-01: Set standards and guidelines before writing any code.; DEV-02: Ask for help after 30 minutes on a problem.; DEV-03: Walk through each other's code.; DEV-04: Validate standards against source code in the database.; DEV-05: Generate code whenever possible and appropriate.; DEV-06: Set up and use formal unit testing procedures.
  • DEV-07: Get independent testers for functional sign-off.Coding Style and Conventions; STYL-01: Adopt a consistent, readable format that is easy to maintain.; STYL-02: Adopt logical, consistent naming conventions for modules and data structures.; STYL-03: Standardize module and program headers.; STYL-04: Tag module END statements with module names.; STYL-05: Name procedures with verb phrases and functions with noun phrases.; STYL-06: Self-document using block and loop labels.; STYL-07: Express complex expressions unambiguously using parentheses.
  • STYL-08: Use vertical code alignment to emphasize vertical relationships.STYL-09: Comment tersely with value-added information.; STYL-10: Adopt meaningful naming conventions for source files.; Variables and Data Structures; Declaring Variables and Data Structures; DAT-01: Match datatypes to computational usage.; DAT-02: Anchor variables to database datatypes using %TYPE and %ROWTYPE.; DAT-03: Use SUBTYPE to standardize application-specific datatypes.; DAT-04: Do not hard-code VARCHAR2 lengths.; DAT-05: Use CONSTANT declarations for variables whose values do not change.
  • DAT-06: Perform complex variable initialization in the executable section.Using Variables and Data Structures; DAT-07: Replace complex expressions with Boolean variables and functions.; DAT-08: Do not overload data structure usage.; DAT-09: Remove unused variables and code.; DAT-10: Clean up data structures when your program terminates (successfully or with an error).; DAT-11: Beware of and avoid implicit datatype conversions.; Declaring and Using Package Variables; DAT-12: Package application-named literal constants together.; DAT-13: Centralize TYPE definitions in package specifications.
  • DAT-14: Use package globals judiciously and only in package bodies.DAT-15: Expose package globals using "get and set" modules.; Control Structures; Conditional and Boolean Logic; CTL-01: Use ELSIF with mutually exclusive clauses.; CTL-02: Use IF...ELSIF only to test a single, simple condition.; CTL-03: Replace and simplify IF statements with Boolean expressions.; Loop Processing; CTL-04: Never EXIT or RETURN from WHILE and FOR loops.; CTL-05: Use a single EXIT in simple loops.; CTL-06: Use a simple loop to avoid redundant code required by a WHILE loop.
  • CTL-07: Never declare the FOR loop index.