Kbase 13530: VALIDATE and CAN-FIND give error 572
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/1998 |
|
VALIDATE and CAN-FIND give error 572
In Version 6, a VALIDATE with CAN-FIND may result in error 572:
** Selection invalid in CAN-FIND phrase. (572)
This usually indicates that Progress has determined that the validate
phrase being used is attempting to apply a selection instead of a
simple validation.
For example, below is a VALIDATE expression which gives this error:
DEF VAR c LIKE customer.cust-num INITIAL "3".
DEF VAR n LIKE customer.name INITIAL "Off The Wall".
PROMPT-FOR customer.cust-num VALIDATE (CAN-FIND (customer WHERE
customer.cust-num = c AND customer.name = n),
"Invalid customer number - please try again").
Why is this statement invalid for Version 6? It's because the
CAN-FIND is actually trying to access specific records in the db.
In Version 7 such a selection of records is allowed, although the
validation above would not be of much use since the legality of the
input cust-num is being evaluated using an entirely separate field,
the "name" field.
If the VALIDATE is done without selecting records, then no such error
results. For example:
PROMPT-FOR customer.cust-num VALIDATE(INPUT cust-num > 0,
"Sorry, cust-num must be greater than zero").
Progress Software Technical Support Note # 13530