Consultor Eletrônico



Kbase 20696: I18N Database Comparison vs 4GL Comparison Explained
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   2/17/2006
Status: Unverified

GOAL:

How database and 4GL comparisons work

GOAL:

Different results returned when comparing

GOAL:

Index-based or 4GL based comparisons

GOAL:

Collation-table differences

FIX:

A database comparison is a comparison the database engine performs against database tables (based on an index).
For example:

FOR EACH CUSTOMER WHERE CUSTOMER.NAME => "A" AND
CUSTOMER.NAME <= "Z" USE-INDEX NAME:
DISPLAY CUSTOMER.NAME <= "JOHN DOE".
END.

A 4GL comparison is a client-based comparison that is based on the value of variables that contain a field value (not based on an index).

For example:

FIND LAST CUSTOMER USE-INDEX NAME.
DEF VAR C AS CHAR.
ASSIGN C = CUSTOMER.NAME.
DISPLAY C <= CUSTOMER.NAME.

Database comparisons and 4GL Comparisons can provide a different result even if the comparison is the same. The main reason that Progress has two separated collation tables; one for the database and another for the current session.

This means that if you run a database comparison with DBCollation "Basic" and the Session:CPCOLL = "german9", you could get different results on screen. The 4GL comparison is based on the Session Collation Table (index are not involved in the query) and database comparison is based on the Database Collation Table (Index are involved in the query).

To check all the session and database internationalization (I18N) parameters use the following code:

find first _db.
display SESSION:charset format "x(15)" label "Internal codepage"
SESSION:stream format "x(15)" label "Stream codepage"
SESSION:CPCOLL FORMAT "x(15)" LABEL "Session COLLATION"
SESSION:CPSTREAM FORMAT "x(15)" LABEL "Session CPSTREAM"
SESSION:CPCASE FORMAT "x(15)" LABEL "Session CPCASE"
SESSION:CPINTERNAL FORMAT "x(15)" LABEL "Session CpInternal"
_db._db-xl-name format "x(15)" label "Db codepage"
_db._db-coll-name format "x(15)" label "Db collation"
WITH 1 COLUMN.


In order to produce a correct result, you should have the Database Collation Table equal to Session Collation Table. You should never have Database Collation Table different to Session Collation Table.