Progress
Language Reference
VALIDATE Statement
Verifies that a record complies with mandatory field and unique index definitions.
SYNTAX
record
The name of the record you want to validate.
To validate a record in a table defined for multiple databases, you must qualify the record’s table name with the database name. See the Record Phrase reference entry for more information.
NO-ERROR
Specifies that any errors that occur in the attempt to validate the record are suppressed. After the VALIDATE statement completes, you can check the ERROR-STATUS system handle for information on any errors that occurred.
EXAMPLEThis procedure prompts for an item number. If an item with that number is not available, the procedure creates a new item record and lets you supply some item information. The VALIDATE statement checks the data you enter against the index and mandatory field criteria for the item record.
NOTES
- Because validation is done automatically, you rarely have to use the VALIDATE statement. Progress automatically validates a record when a record in the record buffer is replaced by another, a record’s scope iterates or ends, the innermost iterating subtransaction block that creates a record iterates, or a transaction ends. For more information on record scoping and subtransaction blocks, see the chapter on block properties in the Progress Programming Handbook .
- Progress automatically validates mandatory fields when those fields are modified.
- If the validation fails on a newly-created record, VALIDATE raises the ERROR condition.
- Progress performs validation when it leaves a field.
- For complex validations, it might be easier to use the IF...THEN...ELSE statement instead of the VALIDATE statement.
- You cannot use the VALIDATE statement to test fields that are referenced in SQL statements, since validation is not performed for these fields.
- If a field or table has been modified, the VALIDATE statement causes WRITE events or occur and all related WRITE triggers to execute.
SEE ALSO
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |