Page 2 of 2

Posted: Fri Feb 22, 2008 9:59 am
by deva
ArndW wrote:Please remember that an empty string, "", is not null. ...
Hi,
Look at the data types . If both are same, then

no need to use stage var/constrain for this. give it in derivation as if IsNull(phone_no) Then N Else Y.

Posted: Fri Feb 22, 2008 10:07 am
by ArndW
IsNull() won't work here (the 3rd time might be a charm)! Use

Code: Select all

Trim(In.Col)#''
as your constraint.

Posted: Fri Feb 22, 2008 10:16 am
by chulett
Yes, please try to keep up. :wink:

And note that there's no "if-then-else" in Arnd's constraint, no "then N else Y' or "then @TRUE else @FALSE" as that is completely unnecessary. These are expressions and they will automagically evaluate to true or false if you let them - and you should let them do so if at all possible.

Re: Inserting NULL records even after defining constraint

Posted: Fri Feb 22, 2008 11:33 am
by satya99
Try this

If isnull(trimf(trimb(LK1.PHONE))) or trimf(trimb(LK1.PHONE)) Then @True else @False

Posted: Fri Feb 22, 2008 5:14 pm
by ray.wurlod
Please try to keep up.

If expression Then @TRUE Else @FALSE is superfluous.

It is sufficient to use (expression) alone.

If the value of expression is "" or 0 (or anything equal to 0) then the result of expression in a Boolean (logical) context is @FALSE. Any other non-null value is regarded as @TRUE.