WebSphere Message Brokers
File: ak05040_
Writer: Bill Oppenheimer

Reference topic

This build: July 31, 2007 21:31:30

IF statement

The IF statement executes one set of statements based on the result of evaluating condition expressions.

Syntax

Each expression is evaluated in turn until one results in TRUE; the corresponding set of statements is then executed. If none of the expressions returns TRUE, and the optional ELSE clause is present, the ELSE clause's statements are executed.

UNKNOWN and FALSE are treated the same: the next condition expression is evaluated. ELSEIF is one word with no space between the ELSE and the IF. However, you can nest an IF statement within an ELSE clause: if you do, you can terminate both statements with END IF.

Example

IF i = 0 THEN
   SET size = 'small';
ELSEIF i = 1 THEN
   SET size = 'medium';
ELSEIF j = 4 THEN
   SET size = 'large';
ELSE
   SET size = 'unknown';
END IF;


IF J> MAX THEN
  SET J = MAX;
  SET Limit = TRUE;
END IF;
Related concepts
ESQL overview
Related tasks
Developing ESQL
Accessing elements in the message body
Related reference
Syntax diagrams: available types
ESQL statements
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:31:30

ak05040_ This topic's URL is: