#100CodeExamples
Sort a Version-String with pure SQL
Ever tried to sort Version-Strings with pure SQL – for example when you want to find the highest Flyway version installed in your database?
Let me show you how you can!
Ever tried to sort Version-Strings with pure SQL – for example when you want to find the highest Flyway version installed in your database?
Let me show you how you can!
My previous solution to split a string into rows by a delimiter, using pure SQL had a couple of small flaws.
Here is the revisited version that also removes a bit of code duplication.
Sometimes we have data that is not split into columns and rows, but SQL can only really thrive on structured data.
But thanks to recursive queries we can split any string into rows – with pure SQL.
It is a common practice to eliminate possible NULL values from your method’s parameters, and in the past I advocated to use subtypes to do this in PL/SQL.
However, it doesn’t work from SQL…
My last example of controlling a sequence to test some default-behavior was not “well-testable” PL/SQL code.
In this example I show how we can achieve a method that is much easier to test, doesn’t require touching internals – all without changing the public API of the method.
A combination of Package global state and Package invalidation can easily lead to ORA-04061 errors, especially in unit-testing situations.
This blog-post explains the problem and shows possible solutions (all with examples)
Unit-Tests are automated checks of certain behavior. But what if we could also use them to describe what the functionality they’re checking is supposed to do?
How to explore some functionality you don’t know but want to change or improve?
Write a unit test with utPLSQL and use the force-manual-rollback param!
#ThanksOGB
How to concatenate a list of Strings in PL/SQL?
This blog-post shows 4 different approaches.
Object Types are a very useful thing when used in PL/SQL, but Oracle even allows us to have them inside a table.
Let’s see how we can put the numeric_strucutre-logic inside the Force Powers table and use indizes on the new column.