PLSQL条件语句
IF THEN ELSE STATEMENT
1)
IF condition
THEN
statement 1;
ELSE
statement 2;
END IF;
2)
IF condition 1
THEN
statement 1;
statement 2;
ELSIF condtion2 THEN
statement 3;
ELSE
statement 4;
END IF
3)
IF condition 1
THEN
statement 1;
statement 2;
ELSIF condtion2 THEN
statement 3;
ELSE
statement 4;
END IF;
4)
IF condition1 THEN
ELSE
IF condition2 THEN
statement1;
END IF;
ELSIF condition3 THEN
statement2;
END IF;
CASE语句
1)
CASE selector
WHEN expression1 THEN operation1
WHEN expression2 THEN operation2
...
WHEN expressionN THEN operationN
ELSE default_operation
END CASE;
2)
CASE
WHEN condition1 THEN operation1
WHEN condition2 THEN operation2
...
WHEN conditionN THEN operationN
ELSE default_operation
END CASE;
PLSQL循环语句
简单一般循环(相当于do while循环)
LOOP
statements;
EXIT;
{or EXIT WHEN condition;}
END LOOP;
While循环
WHILE <condition>
LOOP statements;
END LOOP;
For循环
FOR counter IN val1..val2
LOOP statements;
END LOOP;