VALID
You can use the VALID function to perform conditional processing based on whether an external interface function executes successfully.
VALID returns the result of the first argument if it is valid; otherwise, returns the second argument.
- Syntax:
- VALID ( single-text-expressions , single-general-expression )
- Meaning:
- VALID ( function_that_can_fail , return_value_if_function_fails )
- Returns:
- A single text expression
VALID returns the result of the evaluation of function_that_can_fail if it is valid. If the function fails, VALID returns return_value_if_function_fails.
The following functions can fail:
|
|
|
|
|
|
|
Examples
SomeObject = VALID ( RUN ( "mymap.mmc" , "-OF1 mydata.txt" ) , FAIL ( "My RUN failed!" ) )
If the RUN function returns an error return code, the VALID functions returns none, the map aborts, and the message My RUN failed! is reported under Execution Summary in the execution audit log.
Related functions
- DBLOOKUP
- DBQUERY
- DDEQUERY