Progress
Language Reference
EQ or = Operator
Returns a TRUE value if two expressions are equal.
If characters are being compared, the character values are used to index into the current collation table so that the sort value of the characters are used in the comparison.
SYNTAX
expression
A constant, field name, variable name, or expression. The expressions on either side of the EQ or = must be of the same data type, although one might be an integer and the other a decimal.
EXAMPLEThis procedure prompts for the initials of a sales rep. The FOR EACH block reads all the order records for that sales rep. The DISPLAY statement displays information from each of the retrieved records.
NOTES
- You can compare character strings with EQ. Most character comparisons are case insensitive in Progress. That is, all characters are converted to uppercase prior to comparisons. However, it is possible to define fields and variables as case sensitive (although it is not advised, unless strict ANSI SQL adherence is required). If either expression is a field or variable defined as case sensitive, the comparison is case sensitive and “Smith” does not equal “smith.”
- Characters are converted to their sort code values for comparison. Using the default collation table, all uppercase letters sort before all lowercase letters (for example, a is greater than Z, but less than b.) Note also that in character code uppercase A is less than [ , \ , ^ , _, and ’ , but lowercase a is greater than these.
- If one of the expressions has an unknown value (?) and the other does not, the result is FALSE. If both are unknown, the result is TRUE. However, for SQL, if the value of either or both expressions is unknown, then the result is unknown.
- The equal comparison ignores trailing blanks. Thus, “abc” is equal to “abc “. However, leading and embedded blanks are treated as characters and “ abc” is not equal to “abc”.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |