The following piece of Pl/SQL uses a clever bit of math to be able to raise a number to a very large power without having overflow problems. Suppose, for example, you wanted to calculate 2318 % 367 (2 to the… Read More
Using PRAGMA AUTONOMOUS_TRANSACTION in a Function
Here’s a quick example of how to use the AUTONOMOUS_TRANSACTION pragma in a function: If you use the AUTONOMOUS_TRANSACTION pragma in Pl/SQL, it creates a separate transaction from the transaction you are currently working in. Because we included it in… Read More
Easiest Way to Wrap Pl/SQL Code
In this article, I’ve included the easiest possible way to wrap any piece of existing Pl/SQL code, using an anonymous Pl/SQL block. If you’ve stumbled on this page wondering “what does it mean to wrap Pl/SQL?” just know that it… Read More
Oracle: Coding Around NULL Values
In Oracle, NULLs can complicate your code–a lot. Suppose, for example, you want to see if two different values are the same in a SQL query. You might be tempted to write something like this: The problem with the above… Read More
Get the Oracle Database Version Number
If you’re looking for how to get the Oracle Database Version, there are lots of ways to do so, depending on what your end-goal is. Running A Quick Query The easiest, simplest, fastest method is to run the following query:… Read More