Joined: 14 Oct 2005 Posts: 1187 Location: Bangalore,India
The EVALUATE command provides a shorthand notation for a series of nested IF statements.
Display ' row not found'
Raise an error
In these code if sqlcode is eq to 0 it will execute next sentennce if +100 then it will display row is not found & if it is other than 0 & 100 it will raise the error
The equivalent IF command:
IF (sqlcode>= 0)
IF (sqlcode = 100)
Display 'row not found'
raise an error
Only one WHEN branch is chosen per execution of the EVALUATE, and the checking of the WHEN branches is done from top to bottom.
If none of the WHEN branches can be chosen, and a WHEN OTHER phrase exists, the WHEN OTHER branch is executed.
If none of the WHEN branches can be chosen, and there is no WHEN OTHER phrase, the EVALUATE simply terminates.
Hope it will helpful