Consultor Eletrônico



Kbase P13999: How to compare the contents of character variables and database fields as case sensitive?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   29/07/2005
Status: Verified

GOAL:

How to compare the contents of character variables and database fields as case sensitive?

FIX:

Use the COMPARE function. This function has the advantage that no changes need to be made to database fields or character variables to make them case sensitive. For example, the following sample code shows how to compare a character variable and a database field to see if they are equal when compared as case-sensitive:

DEFINE VARIABLE vSomeString AS CHARACTER NO-UNDO.
IF COMPARE(vSomeString,'=',Customer.Name,'CASE-SENSITIVE') = TRUE THEN

DISPLAY 'Case-Sensitive Comparison Succeeded'.
ELSE

DISPLAY 'Case-Sensitive Comparison Failed'.