|
|
|
|
|
Re: Difference between null & Empty string [message #600813 is a reply to message #600797] |
Tue, 12 November 2013 15:04 |
Solomon Yakobson
Messages: 3273 Registered: January 2010 Location: Connecticut, USA
|
Senior Member |
|
|
Bill B wrote on Tue, 12 November 2013 12:20ORACLE DOES NOT HAVE THE CONCEPT OF EMPTY LIKE T-SQL DOES. it is null or not null only
Not entirely true. Oracle has a concept of empty string. Oracle, as John showed, currently treats empty string as NULL. But it also in some cases treats NULL as empty string. Such case is string concatenation. If, for example, you add two NUMBER operands, e.g. a + b where a is 5 and b is null - result is null. But if we concatenate a || b where a is 'ABC' and b is null, Oracle essentially treats NULL as empty string and result is 'ABC'. Concatenation Operator:
Quote:Although Oracle treats zero-length character strings as nulls, concatenating a zero-length character string with another operand always results in the other operand, so null can result only from the concatenation of two null strings. However, this may not continue to be true in future versions of Oracle Database. To concatenate an expression that might be null, use the NVL function to explicitly convert the expression to a zero-length string.
SY.
[Updated on: Tue, 12 November 2013 15:05] Report message to a moderator
|
|
|
|