I have a table with columns which have a check constraint, Trimmed Length > 0.I tried both of these in the Create Table statement:
create table CUSTOMER (
...
CUST_FNAME varchar(30)
check (char_length(ltrim(rtrim(CUST_FNAME))) is not null),
...
)
create table CUSTOMER (
...
CUST_FNAME varchar(30)
check (char_length(ltrim(rtrim(CUST_FNAME))) > 0),
...
)
and these compile, but they don't work. I am still allowed to enter " " (a blank string) for that column, and even though the trimmed-length check constraint is supposed to prevent me from adding that row, it doesn't. I'm able to successfully enter " " in my field.
Why doesn't it work? Thanks