This website uses cookies to store information on your computer. Some of these cookies are used for visitor analysis, others are essential to making our site function properly and improve the user experience. By using this site, you consent to the placement of these cookies. Click Accept to consent and dismiss this message or Deny to leave this website. Read our Privacy Statement for more.
Brendan Furey

Writing Clean Code in PL/SQL & SQL


Brendan Furey, Cornerstone


 

Abstract

PL/SQL was first released in 1992 as a procedural language for Oracle that allowed direct embedding of SQL. Since then other types of programming paradigm, including object orientation (OO) and functional programming (FP), have become popular outside the database world.In this talk we will discuss how to write PL/SQL APIs with embedded SQL in ways that promote maintainability and testability. We'll discuss best practices in the use of traditional features such as private, public and nested scoping of methods and variables, as well as appropriate use of newer OO features; we'll explain how FP concepts can help us write cleaner code even without advanced FP features such as lambda expressions. Modular construction of complex SQL will be included. Usage advice will be justified with reference to traditional software engineering concepts, such as information hiding and module cohesion and coupling.Ideas will be illustrated with a mix of schematic examples and publicly available code. Attendees should learn:

  • How to use PL/SQL language features to promote cleaner code
  • How concepts from other paradigms such as functional programming can improve programming in procedural languages like PL/SQL
  • How to use modern features of SQL to construct complex statements in a modular way, and so to maximise the use of declarative SQL code within PL/SQL 

Speaker Biography

Consultant database developer with around 25 years experience in many industries, currently working in the Finance sector. Blogger, Europhile and United fan.