Progress
Language Reference


BUFFER-COMPARE Statement

Interfaces
OS
SpeedScript
All
All
Yes

Performs a bulk comparison of two records (source and target) by comparing source and target fields of the same name for equality and storing the result in a field. You can specify a list of fields to exclude, or a list of fields to include. You can also specify WHEN...THEN phrases. For all such phrases you specify, Progress evaluates the WHEN portion, and if it evaluates to TRUE, Progress executes the THEN portion.

SYNTAX

BUFFER-COMPARE source
  [ { EXCEPT | USING } field ... ] TO target
  [ SAVE [ RESULT IN ] result-field ] 
  [ [ EXPLICIT ] COMPARES ] [ NO-ERROR ] :
     [ WHEN field compare-operator expression
        THEN statement-or-block ] ...
  [ END [ COMPARES ] ] 

source

The source database table, buffer, temporary table, or work table.

EXCEPT field

A list of source fields to exclude from the bulk compare.

USING field

A list of source fields to include in the bulk compare. The USING option is a positive version of the EXCEPT option.

TO target

The target database table, buffer, temporary table, or work table.

SAVE RESULT IN result-field

A variable or field to contain the result of the comparison. The variable or field must be CHARACTER or LOGICAL.

If result-field is CHARACTER, the result is a comma-separated list of fields that failed the comparison, sorted in ascending order.

If result-field is LOGICAL, the result is YES if all fields are equal, or NO if any fields are unequal. In either case, BUFFER-COMPARE stops comparing when it encounters the first inequality.

EXPLICIT COMPARES

Opens a block of WHEN options. If you open the block, you must close it with END COMPARES.

NO-ERROR

Diverts any error messages from this statement to the ERROR-STATUS system handle and records the success of this statement in ERROR-STATUS:ERROR.

WHEN field

Any data field in the source.

BUFFER-COMPARE removes this field from a USING list or adds this field to an EXCEPT list. This removes the field from the bulk compare and from result-field.

compare-operator

Represents one of the following: LT, LE, GT, GE, EQ, NE, MATCHES, BEGINS, or CONTAINS.

expression

Any valid Progress expression.

THEN statement-or-block

Any Progress statement or block. The statement or block executes when the WHEN clause evaluates to TRUE.

END COMPARES

Closes the block of WHEN phrases.

NOTES

SEE ALSO

BUFFER-COPY Statement


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095