I have a column in a table that is blank. The weird thing is that it does not appear to be null or an empty string. So, if I do this:
SELECT *
FROM TABLE
WHERE column IS NULL
...or:
SELECT *
FROM TABLE
WHERE column = ''
I get nothing. Thoughts?
Issue this query:
SELECT column, DUMP(column, 1016)
FROM table
It'll show the exact contents.
Related: Oracle does not allow empty strings; they're silently converted to NULL
.
Maybe the column contains only spaces?
Did you try
select * from table where trim(column) is null
Oracle's got a basically permanent annoyance that empty strings are treated as null. However, are you sure that's an empty string? It could be an otherwise invisible character, such as a space or tab/linebreak/linefeed/etc... What does the string length show when you do select length(column) from table
?
Try this:
SELECT *
FROM TABLE
WHERE TRIM(column) IS NULL
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With