×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




We wary of the programming language you are using (in this case SQL).  Some 
languages say
' ' = '  ' (one space and 2 spaces are equal).

Some say
' ' <> '  ' (one space and 2 spaces are not equal).

In some languages, if I have a filed 5 characters long and I want to see if it 
is blank I have to use
if SomeField = '     ' then...

some can use
if SomeField = '' (no spaces = *blanks).

and then some require
if SomeField = ' ' (one space) will work

Regards,

Jim Langston

Carel Teijgeler wrote:

> Douglas Handy wrote:
>
> > It is the same.  There is no difference between a "blank" and a
> > "space" -- they are synonyms for x'40' in EBCDIC.
> >
>
> Not completely true, I fear.
>
> I once did an SQL on a file to retrieve two records that were not correctly
> filled. One character field in those records was empty in comparison to the 
>rest
> of the records.
>
> I wrote SELECT * FROM file WHERE field = ' ' (one space) and I got no result.
> Then I tried SELECT * FROM file WHERE field < ' ' (one space) and the two 
>records
> were returned.
>
> You would expect spaces, but they were *BLANKS.
>
> Carel.

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2026 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].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.