Subject | Re: empty string=null ? |
---|---|
Author | cantak3 |
Post date | 2006-06-26T20:56:30Z |
--- In firebird-support@yahoogroups.com, "roskiy" <roskiy@...> wrote:
(A <> B) returns FALSE
(A = B) returns FALSE
A is an unknown value. It may be empty string, or it may not be
empty string. Therefore A is not B, and also A is not different
than B because it is undetermined.
If your code says:
if (A = B) then
DoSomething;
else
DoSomethingElse;
And you are wanting Null to be different than empty string, you are
simply getting lucky because your code will execute like you
thought, however:
if (A <> B) then
DoSomethingElse;
else
DoSomething;
Will not produce what you wanted.
>This is not correct. Let A = null and B = Empty Str.
> In FB1.5
> empty string<>null
>
(A <> B) returns FALSE
(A = B) returns FALSE
A is an unknown value. It may be empty string, or it may not be
empty string. Therefore A is not B, and also A is not different
than B because it is undetermined.
If your code says:
if (A = B) then
DoSomething;
else
DoSomethingElse;
And you are wanting Null to be different than empty string, you are
simply getting lucky because your code will execute like you
thought, however:
if (A <> B) then
DoSomethingElse;
else
DoSomething;
Will not produce what you wanted.