Re: peeve
Posted in 1993
Netters, I learned Informix so long ago and then went off to do other things, that there are things that came out later that catch me. Null (believe it or not) WAS one of those. In this particular case I'm working with an existing system and making modifications to it. It's a little late to run around changing the schema to my hearts desire - Not that I would have realized the need for it until these started biting me. Obviously we are using NULL incorrectly - we aren't using it to denote 'unknown' - it just means that it has no value to us - or = " ". Thank you all for your input - with a post like that I really deserved a flame - but this is such a kinder gentler net..... I won't credit responses, because I'm using elm and only do one note at a time. What I got out of all your replies was: a) NULL really means unknown. That's like trying to buy a cup of coffee and the guy says "that'll be 75 cents", and you query yourself "do I have .75 cents?" and you don't know so you don't get the coffee, but also don't not get the coffee. It's like differentiation - you approach an infinitely small interval of time in which what really happens doesn't. Actually what I normally do is check my pocket and find out if I really DO have 75 cents - but I guess that cheating - I'm loading a value into the field. And you thought the subjunctive was hard! b) use NOT NULL in the schema. c) use 'without null input' within the form (or words to that effect). I haven't tried this, but it sounds like a good way to keep NULLS out of the database. d) use IF a=b THEN ELSE I like that one. e) What I have done in the past is testing for LENGTH(a)=0 which will be true if a = " " or a IS NULL. This works fine when there is only one variable. (Note - that won't work in SQL - because length(NULL) is not != 0. I imageine that the lower level instruction which is comparing a to b byte for byte says "hey this one doesn't have any bytes" and exits it's little loop without setting either a TRUE or a FALSE. Is this really a three level compare? If I have two apples and Bill has diddly - is my number of apples not NOT EQUAL to Bills'? If this is really a three level compare then we need an instruction to deal with it, I liked: IF a = b THEN ELSE NULL But then which one was NULL? Perhaps someone with a better theoretical knowledge than mine could explain exactly why a NULL is not NOT EQUAL to "x"? j. _____________________________________________________________________________ Jack Parker - Contractor | Hewlett Packard, BSMC Boise, Idaho, USA| If you keep staring at it like that, jparker@hpbs2561.boi.hp.com | your nose is going to grow (208) 396-5388 (W) (208) 384-1623 (H) | into the bark. _____________________________________________________________________________ -- _____________________________________________________________________________ Jack Parker - Contractor | Hewlett Packard, BSMC Boise, Idaho, USA| If you keep staring at it like that, jparker@hpbs2561.boi.hp.com | your nose is going to grow (208) 396-5388 (W) (208) 384-1623 (H) | into the bark. _____________________________________________________________________________