条件控制(if ) ( case)
一: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(定義變量);
?
轉載于:https://www.cnblogs.com/futao123/p/4437419.html
總結
以上是生活随笔為你收集整理的条件控制(if ) ( case)的全部內容,希望文章能夠幫你解決所遇到的問題。