Why allow blank? Why not just set to null? Let me see if I can answer
that for myself:

CREATE TABLE rob/JOEL (MYCHAR CHAR ( 5), CONSTRAINT NOBLANKS
CHECK (mychar<>' ' ))

INSERT INTO rob/JOEL (MYCHAR) VALUES('Y')
1 rows inserted in JOEL in ROB.
INSERT INTO rob/JOEL (MYCHAR) VALUES(' ')
INSERT, UPDATE, or MERGE not allowed by CHECK constraint.
INSERT INTO rob/JOEL (MYCHAR) VALUES(null)
1 rows inserted in JOEL in ROB.

DSPPFM QTEMP/JOEL see Y row and empty row. F10=Display hexadecimal makes
empty row 'look' like blanks but
select * from rob/joel where mychar=' '
only returns 'No data selected for output.'

Granted, in RPG you'd have to process "null indicators" on those columns,
or some such logic.
select;
where nullindMYCHAR=*on;
...
where mychar='Y';
...
EndSl;

But, in answer to your question, use OR not AND. ' ' AND null is like
testing for mychar='x' AND mychar='y'.

Rob Berendt

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].