Re: peeve
Posted in 1993
In <1sopovINNc9h@emory.mathcs.emory.edu> jparker@hpbs2561.boi.hp.com (Jack Parker) writes: >I hate fixing a statement from: >IF a != b THEN ..... >TO >IF a != b >OR (a IS NULL AND b IS NOT NULL) >OR (a IS NOT NULL AND b IS NULL ) THEN ..... >Are there others out there with this prob? Or is it just us? >Why is it that NULL is NOT EQUAL to "xxx", but it is not NOT EQUAL to "xxx" >either? >I'm not looking for the real answer, I'm looking for the explanation >of why grunts like me have to deal with this when it's 'intuitively obvious >to the most casual observer' that NULL should not not NOT EQUAL "xxx". > 1 2 3 Yes I know it's tedious, but the expansion that you specify is not necessarily the desirable behaviour, in fact I think the behaviour I would want most often is IF a != b AND a IS NOT NULL AND b IS NOT NULL THEN ... ELSE ... If you are using NULLS correctly (ie NULL = unknown) then NULL really is != NULL != NOT NULL. If you want the behaviour you specify then a and b probably should be NOT NULL columns/variables. >Even better, when is it going to be fixed? I don't think you would get much sympathy from the designers for the notion that it needs fixing, especially since the implied carry through from what I assume is 4GL to SQL and SPL would make Informix non ANSI standard. I would imagine it was a lot of hard work getting it to behave the way it does.