The point is: empty-string is NOT NULL, just as 0 (zero) is NOT NULL
I've heard and read some smelly stuff, but this statement just plain reeks.
How on earth can an empty string - a string without a value - be compared to a number with
the numeric value zero!?
Cannot be compared directly, eg ('' = 0), ('' <> 0 ) etc., since they are different datatypes, but they are nice equivalents in two different nice worlds (alphanumeric and numeric), real twins.
Zero is a legitimate numeric value!!
So is zero-length-string in alphanumeric world. But what means "legitimate"?
On the other hand though, there is no character value for an empty string. You actually admitted as
much, saying "empty-string has not its own ascii representation code".
Right. But it has nothing to do with your problem. If you really consider THIS to be the problem, never mind - unicode has enough room to do it, as opposed to 8-bit ascii, though the problem is solvable (and is already solved) even in ascii.
Thus an empty string has no value!!
It HAS a value '', it is a known value, but you can't see it.
And now you want to claim it is just like a number data type variable that has the numeric value
zero!??
Right, JUST LIKE. They are not IDENTICAL or EQUAL, but they are equivalents.
Billy and William,
------------------
with all due respect I've got a feeling that one of possible causes of your confusion could be the fact that all we see on our physical screens are only ascii characters, internally represented by its ascii code. When we talk about numbers, dates, strings etc, we just talk about them in the context of operations which can be done on them (mathematical op, dates op, string op etc), but they are always represented on the screen as characters. Please follow me. I'll try to be as simple as possible.
What is this?
125
Is this number 125, or sequence of characters: '1'||'2'||'5' = '125'? If I take it as the number, I presume that mathematical operations are possible with this number, eg (125 * 5) = 625. If I take it as a string of three characters, no math operations are possible, only string operations, eg LENGTH('125') = 3.
In the first case of being the number, what is the LENGTH(125)? Is the LENGTH(125) less than LENGTH(2147483648)? Is the LENGTH(125) unknown or inapplicable or maybe...? Or the length, as an attribute of numbers, is totally senseless, meaninless, pointless ? Even saying "the length of number doesn't exist" is sounding as obtuse tautology. So, what is an "empty number"? Obviously, the number whose "length" is zero. Give me that number.
The same applies to the DATE datatypes. What is this?
12-DEC-2005
Is this the date 12-DEC-2005, or the string whose length is 11 characters: '12-DEC-2005'? If I consider it to be the date, what is the LENGTH(12-DEC-2005)? May I say 24 hours? Sounds pretty idiotic. Maybe NULL? But in 3VL, NULL means the length of the date exists but we do not know it, since the Lord is not willing to tell us. So, it cannot even be NULL. What could then be an "empty date"? The date whose "length" is zero? Give me that date.
But if you ask me to give you a string whose length is zero, I'll give you: ''. Because strings are ordered sequences of dummy characters:
' Di*jks5%43@zccHY9K>}(A((99-+$3#!2jshQ'
' Di*jks5%43@zccHY9K>}(A((99-+$3#!2jshQ'
' Di*jks5%43@zccHY9K>}(A((99-+$3#!2jshQ'
' Di*jks5%43@zccHY9K>}(A((99-+$3#!2jshQ'
' Di*jks5%43@zccHY9K>}(A((99-+$3#!2jshQ'
' Di*jks5%43@zccHY9K>}(A((99-+$3#!2jshQ'
' Di*jks5%43@zccHY9K>}(A((99-+$3#!2jshQ'
' Di*jks5%43@zccHY9K>}(A((99-+$3#!2jshQ'
' Di*jks5%43@zccHY9K>}(A((99-+$3#!2jshQ'
' Di*jks5%43@zccHY9K>}(A((99-+$3#!2jshQ'
' Di*jks5%43@zccHY9K>}(A((99-+$3#!2jshQ'
' Di*jks5%43@zccHY9K>}(A((99-+$3#!2jshQ'
' Di*jks5%43@zccHY9K>}(A((99-+$3#!2jshQ'
' Di*jks5%43@zccHY9K>}(A((99-+$3#!2jshQ'
' Di*jks5%43@zccHY9K>}(A((99-+$3#!2jshQ'
'Di*jks5%43@zccHY9K>}(A((99-+$3#!2jshQ'
Look at this set of sequences and don't tell me that you cannot "see" the empty-string or more better: the zero-length-string.
More then this, I really cannot help you.
Regards
Albert