新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
Oracle數(shù)據(jù)庫各類控制語句的使用詳細(xì)介紹
Oracle數(shù)據(jù)庫各類控制語句的使用是本文我們主要要介紹的內(nèi)容,包括一些邏輯控制語句、Case when的使用、While的使用以及For的使用等等,接下來我們就開始一一介紹這部分內(nèi)容,希望能夠?qū)δ兴鶐椭?/p>

站在用戶的角度思考問題,與客戶深入溝通,找到張家港網(wǎng)站設(shè)計(jì)與張家港網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗(yàn),讓設(shè)計(jì)與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個(gè)性化、用戶體驗(yàn)好的作品,建站類型包括:成都網(wǎng)站制作、做網(wǎng)站、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、域名注冊(cè)、網(wǎng)站空間、企業(yè)郵箱。業(yè)務(wù)覆蓋張家港地區(qū)。
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 --elsif not elseif!!!!
- dbms_output.put_line('Big Than 5');
- else
- dbms_output.put_line('En?');
- end if;
- end;
Case when 的使用的兩種方式
(1)
- 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;
(2)
- 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;
關(guān)于Oracle數(shù)據(jù)庫各類控制語句的使用就介紹到這里了,希望本次的介紹能夠?qū)δ兴斋@!
當(dāng)前名稱:Oracle數(shù)據(jù)庫各類控制語句的使用詳細(xì)介紹
本文來源:http://www.dlmjj.cn/article/cdhgops.html


咨詢
建站咨詢
