General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Jim,
Thanks for this information. At this point I'm pretty sure I understand the majority of the issues pertaining to NULLs, but I just want to clarify a few more points. (Please bear with my confusion) I am confused by your statement:
'according to the rules EMPTY(NULL) should return NULL as the empty status is unknown.'
Do you mean that the expression EMPTY(NULL) SHOULD return NULL or DOES return NULL? You said SHOULD, so I guess that is what you mean?
Because the expression
store empty(NULL) to llvalue
stores .f. in llvalue
(I guess not because it is false, but because it is unknown, and vfp doesn't know what else to do with it?) I understand the general point that numeric or character expressions that have NULL in them always evaluate to NULL - like:
1+NULL=NULL
But anytime you use NULL in a place where VFP is expecting a logical expression, vfp seems to treats it as a false, regardless of whether the expression is NULL or NOT NULL, as follows:
IF NULL
wait wind "ITs a cold day in hell"
else
wait wind 'it is warm in hell'
endif
IF NOT NULL
wait wind "ITs a cold day in hell"
else
wait wind 'it is warm in hell'
endif
In the case above, I guess the vfp compiler could return an error, like a data type mismatch as it does if you say "if 'abc'", but instead it evaluates to false. I think otherwise it would have the potential to break a lot of programs.
So I guess my question is: Are you saying that the expression
empty(NULL) SHOULD be treated in the same way that vfp treats an expression such as 1+NULL, i.e. that the return value should be NULL, not .f., and that therefore vfp is incorrect in the way it handles empty(NULL) ? It seems to me that if vfp handled it that way it would also break a lot of programs.
I hope this makes sense. Thanks again for your help.
>David,
>
>NULL is NOT EMPTY() it is NULL. NULL means unknown and if the value is unknown then it may be emtpy or it may not that information is unkown and according to the rules EMPTY(NULL) should return NULL as the empty status is unknown. NULL is NOT .F. nor is it .T., it is NULL.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only