Oracle数据库各类控制语句的使用是本文我们主要要介绍的内容,包括一些逻辑控制语句、Case when的使用、While的使用以及For的使用等等,接下来我们就开始一一介绍这部分内容,希望能够对您有所帮助。

Oracle 中逻辑控制语句 

If elsif else end if  
set serverout on;  
declare per_dep_count number;  
begin  
select count(*) into per_dep_count from emp;  
if per_dep_count>0 then  
dbms_output.put_line('Big Than 0');  
elsif per_dep_count>5 then <span style="font-size:24px;color:#ff0000;"><strong>--elsif not elseif!!!!   
</strong></span>        dbms_output.put_line('Big Than 5');  
else  
dbms_output.put_line('En"htmlcode">
declare per_dep_count number;  
begin  
select count(*) into per_dep_count from emp;  
case per_dep_count  
when 1 then  
dbms_output.put_line('1');  
when 2 then  
dbms_output.put_line('2');  
else  
dbms_output.put_line('else');  
end case;  
end;  

第二种使用方式

declare per_dep_count number;  
begin  
select count(*) into per_dep_count from emp;  
case   
when per_dep_count=1 then  
dbms_output.put_line('1');  
when per_dep_count=2 then  
dbms_output.put_line('2');  
else  
dbms_output.put_line('else');  
end case;  
end;  

While 的使用 

declare v_id number:=0;  
begin  
while v_id<5 loop  
v_idv_id:=v_id+1;  
dbms_output.put_line(v_id);  
end loop;  
end;  

For的使用 

declare v_id number:=0;  
begin  
for v_id in 1..5 loop  
dbms_output.put_line(v_id);  
end loop;  
end; 

关于Oracle数据库各类控制语句的使用就介绍到这里了,希望本次的介绍能够对您有所收获!

标签:
Oracle数据库控制语句,控制语句,Oracle数据库基本语句,Oracle逻辑控制语句

免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
狼山资源网 Copyright www.pvsay.com

评论“详解Oracle数据库各类控制语句的使用”

暂无“详解Oracle数据库各类控制语句的使用”评论...

P70系列延期,华为新旗舰将在下月发布

3月20日消息,近期博主@数码闲聊站 透露,原定三月份发布的华为新旗舰P70系列延期发布,预计4月份上市。

而博主@定焦数码 爆料,华为的P70系列在定位上已经超过了Mate60,成为了重要的旗舰系列之一。它肩负着重返影像领域顶尖的使命。那么这次P70会带来哪些令人惊艳的创新呢?

根据目前爆料的消息来看,华为P70系列将推出三个版本,其中P70和P70 Pro采用了三角形的摄像头模组设计,而P70 Art则采用了与上一代P60 Art相似的不规则形状设计。这样的外观是否好看见仁见智,但辨识度绝对拉满。