IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Something I should have known...
Just wanted to share with you all a dumb-attack that has held me up for a few days.

Put simply: I forgot that the following statement is False:

NULL <> 'Something'

Perhaps it's fundamental database knowledge, but my programmer brain took ages to consider even the possibility that a Null, compared with something, could be not not equal. I mean, NULL isn't something. So how can they possibly be not unequal?

Sigh. Didn't help that the tool I'm using (DataStage) doesn't have absolutely brilliant debugging capabilities...

Anyway, I'm over it. Feel free to point and laugh (or will someone, anyone, please say "oh, I didn't know that either!" :-) )
On and on and on and on,
and on and on and on goes John.
New Valid in older versions of T-SQL
I've had to clean up some old stored procedures where the comparison used to be valid but got updated in the ANSI standards. Personally, I think the comparators should be illegal for Null values - or it least the dang compiler ought to warn you.
New I should probably have twigged earlier
Becuase this whole 'NULL really is NULL' thing was helpful when we were using MIN() and MAX() to find which row actually had real data in it. But yeah, would have been nice to be warned. Then again, guess it'd be nice to have more experience. But hey, after his little episode, I guess I do :-)

As it happens we were getting an information msg from Oracle when the MIN() function discovered NULLS - and DataStage decided to flag that as a Fatal Error and crash the program. Sheesh. Anyway... just part of the Joy Of Programming, I guess :)

On and on and on and on,
and on and on and on goes John.
New I'm not sure that really makes sense.
I mean, why doesn't it work? NULL is not the same as a real value - unless SQL uses NULL to mean undefined and therefore a comparison is meaningless (in at least two programming languages I know, a null is a special value of a special type). I must admit I've used IS NULL in a WHERE a few times, but mostly because I saw that expression in the manual. If I hadn't see it I probably would have tried = NULL.

Then again, a NULL in a database cell simply doesn't create that array entry in PHP's SQL interface when getting a recordset. Which is entirely consistent with how PHP works.

Wade.

"All around me are nothing but fakes
Come with me on the biggest fake of all!"

New Yup, that (your 'unless') is it - so it *does*make sense.
New That's how I've always used it
I've never used it or seen it used any other way than:

IS NULL
or
IS NOT NULL

In this context, NULL is a state instead of a value.

~~~)-Steven----

"I want you to remember that no bastard ever won a war by dying for his country.
He won it by making the other poor dumb bastard die for his country..."

General George S. Patton
     Something I should have known... - (Meerkat) - (5)
         Valid in older versions of T-SQL - (ChrisR) - (1)
             I should probably have twigged earlier - (Meerkat)
         I'm not sure that really makes sense. - (static) - (2)
             Yup, that (your 'unless') is it - so it *does*make sense. -NT - (CRConrad)
             That's how I've always used it - (Steven A S)

At least as intelligible as your X-Man666.JPG monologues.
37 ms