Page 1 of 1

How to check if a column is blank

Posted: Tue Aug 22, 2006 2:18 pm
by Shree0410
Hi guys,

I have a column 'DOC1' which is 10 bytes CHAR.
I have to populate 'A' if this column is blank.
I am using the logic If (IsNull(DOC1) Or DOC1=" ") Then DOC1 = A Else DOC1.

Somehow, this logic is not catching the blanks on the DOC1, Is there a way to check for the SPACES on this field?

Thanks

Posted: Tue Aug 22, 2006 2:22 pm
by srimitta
If Len(Trim(DOC1)) < 1 Then 'A' Else DOC1

Posted: Tue Aug 22, 2006 2:55 pm
by Shree0410
Thanks for the help, it worked.

Posted: Wed Aug 23, 2006 2:56 am
by ray.wurlod
This can not work in a parallel job, where a CHAR must contain the correct number of characters.