简单条件判断语句
SQL> declare
2 myage number := 10;
3 begin
4 if myage < 11 then
5 dbms_output.put_line(‘I am a child‘);
6 end if;
7 end;
8 /
I am a child
PL/SQL procedure successfully completed.
SQL> 2
2* myage number := 10;
SQL> ch /10/14
2* myage number := 14;
SQL> /
PL/SQL procedure successfully completed.
二重条件判断语句
SQL> declare
2 myage number :=18;
3 begin
4 if myage < 11 then
5 dbms_output.put_line(‘I am a child‘);
6 else
7 dbms_output.put_line(‘I am not a child‘);
8 end if;
9 end;
10 /
I am not a child
PL/SQL procedure successfully completed.
多重条件判断语句
SQL> set serveroutput on
SQL> declare
2 myage number:=30;
3 begin
4 if myage < 11 then
5 dbms_output.put_line(‘I am a child‘);
6 elsif myage < 20 then
7 dbms_output.put_line(‘I am young‘);
8 else
9 dbms_output.put_line(‘I am alawys young‘);
10 end if;
11 end;
12 /
I am alawys young
PL/SQL procedure successfully completed.
『ORACLE』 PLSQL条件控制语句(11g)
标签:output server procedure let ora put 控制 bsp not
本条技术文章来源于互联网,如果无意侵犯您的权益请点击此处反馈版权投诉 本文系统来源:http://www.cnblogs.com/KT-melvin/p/6849934.html