Subject | Re: clearing comboBox in grid does not produce NULL |
---|---|
Author | scronkey |
Post date | 2003-04-02T03:50:43Z |
Thanks for the reply,
After further investigation, I have realised that it IS setting the
field to NULL when I clear the combobox.
The only way to detect it though, is through
IF (new.STK_ID IS NULL) THEN
...
But why doesn't IF (old.STK_ID <> new.STK_ID) THEN
work?
I don't really want to explicitly test for NULL, I just want to
react when the value changes.
And going from a value to NULL, to my knowledge, is a change.
But it is not being picked up like this.
Any ideas why IF (new.STK_ID IS NULL) works, but the other option
does not?
Is it because, like you said, NULL is a state not a value, and you
cannot compare a value with a state?
Is my only option to explicitly test for NULL first?
-Ryan
After further investigation, I have realised that it IS setting the
field to NULL when I clear the combobox.
The only way to detect it though, is through
IF (new.STK_ID IS NULL) THEN
...
But why doesn't IF (old.STK_ID <> new.STK_ID) THEN
work?
I don't really want to explicitly test for NULL, I just want to
react when the value changes.
And going from a value to NULL, to my knowledge, is a change.
But it is not being picked up like this.
Any ideas why IF (new.STK_ID IS NULL) works, but the other option
does not?
Is it because, like you said, NULL is a state not a value, and you
cannot compare a value with a state?
Is my only option to explicitly test for NULL first?
-Ryan
> It's "known" but not a "problem". It is the way nullbehaves "null is a
> state, not a value". The lookup dataset has to have a unique keyand, of
> course, NULL cannot be a unique key, since it is not a value.i.e. a null
> lookup key will NOT keylink to a null polling key, since null=nullalways
> evaluates to False.to set
>
> If you need to enable the use of the lookup-keysource relationship
> the polling key to null, then you need to include a non-null dummykey in
> the lookup set that will map to a non-null value (a dummyrepresenting
> "null") in the polling column. Then, in your Before Insert andBefore
> Update triggers, you detect this dummy value and set the column toI use
> null. For an integer key, I usually use -1; for a character key,
> '*'...but it can be whatever you need it to be.
>
> Helen