Answered Why check for ? on a char field

Venkateswarlu N

New Member
Is there any real reason why we have to do this

for each customer where city <> "" and city <> ? no-lock:

And why is there no data type compatibility error when checking character field against ?.

Thanks,
Venky
 

RealHeavyDude

Well-Known Member
  1. ? means the value is not defined. Depending on your use case that can have a different meaning to your business logic as an empty string where the value is defined.
  2. The value of any data type can be undefined unless you explicitely have a validation in place ( for example defining it as mandatory ). Therefore you can assign ? to anything.
Heavy Regards, RealHeavyDude.
 

GregTomkins

Active Member
I think you can just say > "", rather than the AND, but I don't have Progress in front of me right now to double check.

We have arguments sometimes over whether every field should be tagged mandatory in the schema. In principle I think the answer is Yes, but in reality, we don't do this and it's another thing that seems sloppy but virtually never causes actual problems for us.
 
Top