一:IF應用格式
(1) (2) (3)
IF 條件 THEN IF 條件 THEN IF 條件1 THEN
--代碼塊 ?????? --代碼塊 ?? --代碼塊1
commit; commit; commit;
dbms_output.put_line(); dbms_output.put_line(); dbms_output.put_line();
ENDIF; ELSE ELSIF 條件2 THEN
dbms_output.put_line(); --代碼塊2
ENDIF; ELSE
? dbms_output.put_line();
?? ? ENDIF;
二:case應用格式
(1)? 只可用在等值情況
case 列名
when?值 then
--(定義變量 提示的 值)
when 值 then
--(定義變量 提示的 值)
……
end case;
dbms_output.put_line(定義變量);
(2):可用在等值情況? 和 不等著情況
case 列名
when 列名=值 then
--(定義變量 提示的 值)
when 列名=值 then
--(定義變量 提示的 值)
……
end case;
dbms_output.put_line(定義變量);
?