Control Statement
|
Description
|
---|---|
set variable = expression
|
Assigns a value to a variable. The value can be either a literal value (for example, 10 or 'text') or another variable. Parameters are considered as normal variables.
|
variable ::= expression
|
Alternate syntax for assigning values to variables.
|
while
expr loop statement-list end loop |
Loops while expression is true.
|
leave
|
Leaves the innermost while loop and continues executing the procedure from the next statement after the keyword end loop.
|
if
expr then statement-list1 else statement-list2 end if |
Executes statements-list1 if expression expr is true; otherwise, executes statement-list2.
|
if
expr1 then statement-list1 elseif expr2 then statement-list2 end if |
If expr1 is true, executes statement-list1. If expr2 is true, executes statement-list2. The statement can optionally contain multiple elseif statements and also an else statement.
|
return
|
Returns the current values of output parameters and exits the procedure. If a procedure has a return row statement, return behaves like return norow.
|
return sqlerror of cursor-name
|
Returns the sqlerror associated with the cursor and exits the procedure.
|
return row
|
Returns the current values of output parameters and continues execution of the procedure. Return row does not exit the procedure and return control to the caller.
|
return norow
|
Returns the end of the set and exits the procedure.
|