Oracle – Simple/Reusable Statement Runner Using PL/SQL Table Type (Collection)

In an Oracle anonymous block based script, how many times do you run into situations where what needs to be done remains a constant but what that logic works with, keeps changing? Parameters are a great way to do it too but in the illustration below, we are going to use PL/SQL table type (collection). … Continue reading Oracle – Simple/Reusable Statement Runner Using PL/SQL Table Type (Collection)

Oracle PL/SQL – Fastest Way To Execute Code Is? To, Not Execute It! – Function Result Caches – Part I

What is the fastest way to execute a PL/SQL function? If you paid attention to the title, your answer would be “to not execute it at all”. In fact, that is the correct answer and Oracle provides the means to do it. The magic is possible because of an Oracle feature called result cache which […]

Oracle – Compare Text Files With 10 Million Lines In 10 Minutes Using 10 Lines Of Code – EXTERNAL Tables

The goal of this post is to compare two text files that may have millions of lines and compare them to quickly find out which lines differ using Oracle EXTERNAL tables. As an Oracle professional, “external tables” are something you may already be familiar with or maybe you have heard about them but not used … Continue reading Oracle – Compare Text Files With 10 Million Lines In 10 Minutes Using 10 Lines Of Code – EXTERNAL Tables

Oracle – PL/SQL – Using ROW/TABLE Locks To Implement Application/Job Semaphore To Handle Race Conditions

What is a Semaphore? Instead of a clinical illustration of exclusive row lock and exclusive table lock usage in Oracle, here we will try to use them to highlight a higher level concept – Implement a semaphore mechanism. Wikipedia defines semaphore as below: In computer science, a semaphore is a variable or abstract data type … Continue reading Oracle – PL/SQL – Using ROW/TABLE Locks To Implement Application/Job Semaphore To Handle Race Conditions

Oracle – Find Hard-coded Dates In PL/SQL Code Using Regular Expressions

Recently a situation came up in PL/SQL code where the format specifier for date was misplaced. Oracle did not complain because it can implicitly convert strings to date. It may not even fail at run-time under most circumstances (always recommend using an explicit format specification though). This is the SQL ..but the Developer meant this: … Continue reading Oracle – Find Hard-coded Dates In PL/SQL Code Using Regular Expressions