|
|
|
|
|
by perl4ever
2242 days ago
|
|
VBA seems to have null, empty, "" and nothing, all of which have different semantics. But only variants can be null or empty, I believe; if you have a typed variable like a Date or a String, you're out of luck. And then, I was using either Power Automate or SharePoint/odata and it turned out "null" does not have the "normal" null semantics, and to test for null, you simply check if something is equal to it. I think I remember from using SQL Server that there is a option that you can treat null either way. Microsoft has a weird relationship with null. On the other hand, I'm sure someone has complained about Oracle's idea that empty strings are null values. And once you think about it, SQL's handling of nulls is weirdly inconsistent, because the special handling of them doesn't always apply in aggregates. Somewhere I had a book by C.J. Date/Hugh Darwen in which I remember a rant about how nulls are a terrible offense against the true relational model. |
|
That's true, only Variants can be Null (Null is a state of Variant); however, Empty is translated to whatever default value makes sense for some of the (non-Object, non-user-defined) data types:
(The above compiles and runs, and - no surprise - numerics are made zero, and string made "".)>I'm sure someone has complained about Oracle's idea that empty strings are null values.
I have certainly complained about that: I mean, what's not to love about conflating "this field intentionally left blank" with "no certain value could be obtained for this field"? /s
>...a rant about how nulls are a terrible offense against the true relational model...
By way of Wikipedia, found this: https://www.dcs.warwick.ac.uk/~hugh/TTM/TTM-TheAskewWall-pri.... A fine read. I am left wondering about how OUTER JOINs would be handled without NULLs. I am now also wondering if it was OUTER JOINs that made NULLs seem necessary.