自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Oracle數(shù)據(jù)庫各類控制語句的使用詳細介紹

數(shù)據(jù)庫 Oracle
本文我們主要介紹了Oracle數(shù)據(jù)庫中各種控制語句的使用,包括邏輯控制語句、Case when的使用、While的使用以及For的使用等,希望本次的介紹能夠?qū)δ兴斋@!

Oracle數(shù)據(jù)庫各類控制語句的使用是本文我們主要要介紹的內(nèi)容,包括一些邏輯控制語句、Case when的使用、While的使用以及For的使用等等,接下來我們就開始一一介紹這部分內(nèi)容,希望能夠?qū)δ兴鶐椭?/p>

Oracle 中邏輯控制語句  

 

  1. If elsif else end if    
  2. set serverout on;    
  3. declare per_dep_count number;    
  4. begin    
  5. select count(*) into per_dep_count from emp;    
  6. if per_dep_count>0 then    
  7. dbms_output.put_line('Big Than 0');    
  8. elsif per_dep_count>5 then <span style="font-size:24px;color:#ff0000;"><strong>--elsif not elseif!!!!     
  9. </strong></span>                dbms_output.put_line('Big Than 5');    
  10. else    
  11. dbms_output.put_line('En?');    
  12. end if;    
  13. end;  

 

Case when 的使用的兩種方式  

(1)  

 

  1. declare per_dep_count number;    
  2. begin    
  3. select count(*) into per_dep_count from emp;    
  4. case per_dep_count    
  5. when 1 then    
  6. dbms_output.put_line('1');    
  7. when 2 then    
  8. dbms_output.put_line('2');    
  9. else    
  10. dbms_output.put_line('else');    
  11. end case;    
  12. end;   

 

(2)  

 

  1. declare per_dep_count number;    
  2. begin    
  3. select count(*) into per_dep_count from emp;    
  4. case     
  5. when per_dep_count=1 then    
  6. dbms_output.put_line('1');    
  7. when per_dep_count=2 then    
  8. dbms_output.put_line('2');    
  9. else    
  10. dbms_output.put_line('else');    
  11. end case;    
  12. end;   

 

While 的使用  

 

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

 

For的使用  

 

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

 

關(guān)于Oracle數(shù)據(jù)庫各類控制語句的使用就介紹到這里了,希望本次的介紹能夠?qū)δ兴斋@!

【編輯推薦】

  1. 如何用SAS宏實現(xiàn)Oracle中的decode函數(shù)?
  2. Oracle數(shù)據(jù)庫日期范圍查詢的兩種實現(xiàn)方式
  3. Oracle數(shù)據(jù)庫只讀模式的CACHE BUFFERS CHAINS測試
  4. Oracle 10g數(shù)據(jù)庫中UNDO_RETENTION參數(shù)的使用詳解
  5. Oracle 10g默認歸檔路徑在閃回區(qū)的2G空間大小限制問題
責任編輯:趙鵬 來源: CSDN博客
相關(guān)推薦

2010-04-02 12:23:30

Oracle數(shù)據(jù)庫

2011-08-05 13:17:34

Oracle數(shù)據(jù)庫閃回個性

2011-07-27 11:08:49

Oracle數(shù)據(jù)庫EM Console重

2010-04-15 15:42:11

Oracle數(shù)據(jù)庫

2011-08-11 16:29:49

Oracle數(shù)據(jù)庫AWRASH

2011-05-26 13:29:30

ORACLE數(shù)據(jù)庫升級

2010-04-15 13:01:25

Oracel數(shù)據(jù)庫

2015-10-28 14:45:35

ORACLE AIO異步IO

2015-10-28 17:39:04

ORACLE AIO異步IO

2011-03-21 13:21:23

數(shù)據(jù)庫開發(fā)規(guī)范

2010-05-07 17:39:02

Oracle數(shù)據(jù)庫性能

2011-05-26 15:27:08

Oracle數(shù)據(jù)庫

2010-04-20 11:41:55

Oracle數(shù)據(jù)庫

2010-04-23 14:32:01

Oracle數(shù)據(jù)庫

2010-04-23 16:05:50

Oracle數(shù)據(jù)庫

2010-04-07 09:31:02

Oracle數(shù)據(jù)庫

2011-05-17 13:43:23

Oracle數(shù)據(jù)庫

2009-08-24 18:09:13

C#調(diào)用Oracle數(shù)

2010-03-18 09:28:14

Oracle數(shù)據(jù)庫遷移

2010-04-28 18:38:51

Oracle虛擬數(shù)據(jù)控
點贊
收藏

51CTO技術(shù)棧公眾號