Reflections
Goodbye, Farewell, and what I’ve Learned
Today is my last day at smenso, where I've worked for the past 6 years. Here are the things I want to write down - mainly so I can reread it in the future and remember.
Hi, I’m Developer Sam and this is my public online-space. I write mainly about software development with a focus on testable database development and code quality, but am not limiting myself to these topics, because I’m a whole person.
Today is my last day at smenso, where I've worked for the past 6 years. Here are the things I want to write down - mainly so I can reread it in the future and remember.
PL/SQL provides three different types of collections to hold multiple items of data. They all come with different capabilities and limitations and since these are hard to remember, I provide a condensed showcase of the different collection types in one single code example.
I already wrote about how much I like the XML generating capabilities of modern SQL, but most examples come only with one or two levels of depth. What if you want to create deeply nested XML and JSON directly from SQL?
Recursive CTEs (WITH-clause) is one addition to the SQL standard that makes the language incredibly powerful. Besides other things it can be used to generate data rows "from thin air" - for example a list of quarters by year. SQL is your friend!
One of my favorite features of (Oracle-)SQL is how easy it is to turn relational data into other data formats like JSON or XML. But what if you need to add a namespace to some of the nodes in your generated XML? I struggled with that until I made a realization about the nature of the xlmns part in XML.
One of the probably most unnerving things in databases is dealing with NULLs, especially when comparing data. The necessary logic to deal with NULLs can lead to very verbose code - but if you're using Oracle, there is a very neat function you can use.