Consultor Eletrônico



Kbase P160226: A text comparison returns different results depending if one of the strings is in the database.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   15/02/2010
Status: Unverified

SYMPTOM(s):

A text comparison returns different results depending if one of the strings is in the database.

A comparison with two text literals in the editor returns No.

A comparison with a text literal and a database string returns Yes, when it should return No.

For example:

MESSAGE ("éénmalige korting" > "zzzzzzzzzzzzzzzzzzzz") VIEW-AS ALERT-BOX.

Retruns No in the procedure editor. But

MESSAGE (<DBtable>.<feld> > "zzzzzzzzzzzzzzzzzzzz") VIEW-AS ALERT-BOX.

where <DBtable>.<feld> in the database has a value of "éénmalige korting", returns Yes.

FACT(s) (Environment):

The database and client both use the iso8859-1 code page and Basic collation.
All Supported Operating Systems
Progress 6.x
Progress 7.x
Progress 8.x
Progress 9.x
OpenEdge 10.x

CAUSE:

The cause of the problem is that the data (the 2 extended characters 'éé') in the database are corrupt. The database uses the iso8859-1 code page, and if these two characters were stored in the database they would have a character value of 233 (Hex E9). But here they have a different value. In this particular database a value of 130, which is a low quotation mark (?) - a little like a comma. So essentially the comparison that is taking place and returning the 'correct' result of Yes with Basic collation, is:

MESSAGE ("??nmalige korting" > "zzzzzzzzzzzzzzzzzzzz") VIEW-AS ALERT-BOX.

FIX:

Determine the cause of the data corruption. Address this problem and then correct the data by deleting it and re-adding it.