Key takeaways
- Oracle treats an empty string as NULL. Databricks treats it as a real value.
- Nothing fails when you migrate. The code runs, and some results quietly change.
- Filters, counts, joins and labels are where it shows up first, usually in reports finance relies on.
- Row counts won't reveal it. Only proof against your legacy results does.
- It's one small difference among many, and at the scale of a real Oracle estate, finding them all is specialist work.
Short answer: Oracle stores an empty string ('') as NULL. Databricks keeps '' as a real value that is not NULL. Code that ran correctly on Oracle can run on Databricks without a single error and still return different rows, different counts and different labels. It's one of the first differences we look for, and one of the easiest to miss.
This is the first article in our series on Oracle to Databricks migration. For the bigger picture, start with our guide to migrating Oracle stored procedures to Databricks.
Two platforms, two definitions of "empty"
Oracle's own documentation says it plainly: the database treats a character value with a length of zero as null. Decades of Oracle code were written around that behaviour, often without anyone realizing it.
Databricks follows the SQL standard instead: an empty string is a value, and NULL means unknown (Databricks NULL semantics).
Neither is wrong. But the same code, on the same data, now takes a different path.
Where it shows up
The effect is rarely where people look first. In migrations we've worked on, it typically surfaces as:
- Reports with missing rows. A filter that used to catch "no value" quietly stops catching some of them.
- Counts that drift. Totals by region, status or category move, and nobody can say why.
- Joins that change. Records that never matched on Oracle start matching on Databricks, or the reverse.
- Labels and keys that go blank. Text built from several columns can come out empty where it used to be fine.
None of these raises an error. The job turns green. The numbers are just different.
A real example
In one of our validation runs, a converted procedure was syntactically perfect and ran cleanly on Databricks. But the new output contained rows that had never existed in the Oracle output. The cause was a single comparison against a parameter whose default was empty: on Oracle it matched nothing, on Databricks it matched every empty value.
No code review would have flagged it. Only comparing the new results with the legacy results did.
Why it's hard to catch at scale
On one procedure, this is a curiosity. Across hundreds of procedures, packages and years of data, it's a different problem:
- It spreads. One empty-string column changes a filter, which changes a join, which changes a total three steps later, far from the original cause.
- It hides. Row counts and top-line totals can match while the values underneath don't.
- It's not alone. Empty strings are one of several quiet differences between Oracle and Databricks, alongside dates, numeric precision and sort order. They interact.
- It needs a decision. Whether "empty" should mean "missing" or "known to be blank" is a business call per column, and it has to be made consistently across the estate.
That's why migrations rarely stall on rewriting SQL. They stall on proving the results.
How ITACC handles it
At ITACC, we've built our own migration tooling and method around one principle: every migrated object is proven against your legacy results, or flagged with the reason. Nothing silently wrong.
We convert Oracle SQL and PL/SQL to Databricks while keeping the behaviour your business logic depends on, and we hand you the evidence: what matches, what differs, and why. Your team spends its time on decisions, not on chasing numbers.
The next article in this series covers Oracle NUMBER and Databricks DECIMAL: keeping exact numbers exact. If you also run Informatica, see what maps cleanly from PowerCenter to Databricks.
ITACC is an AI and data engineering partner based in Oakville, Ontario. Learn more about our data and workflow automation work.
Frequently asked questions
Does Oracle treat an empty string as NULL?
Yes. Oracle Database treats a character value with a length of zero as null, in 19c, 21c and 26ai. Oracle's documentation recommends not relying on this, but a lot of existing code does.
Does Databricks treat an empty string as NULL?
No. On Databricks, '' is a string of length zero and is not NULL, so code that relied on Oracle's behaviour can return different results.
Will our migrated code show an error if this affects us?
Usually not. The code runs normally and the results differ, which is why proving results against the legacy system matters more than checking that the code runs.
How do we know if our Oracle estate is affected?
Most Oracle estates are, to some degree. The reliable way to know is to compare migrated outputs with legacy outputs on real data. We can show you on one of your own procedures.