夢幻之旅

          DEBUG - 天道酬勤

             :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            671 隨筆 :: 6 文章 :: 256 評論 :: 0 Trackbacks
          <2011年7月>
          262728293012
          3456789
          10111213141516
          17181920212223
          24252627282930
          31123456

          公告

          本博客中未注原創的文章均為轉載,對轉載內容可能做了些修改和增加圖片注釋,如果侵犯了您的版權,或沒有注明原作者,請諒解

          常用鏈接

          留言簿(21)

          隨筆分類(644)

          隨筆檔案(669)

          文章檔案(6)

          最新隨筆

          積分與排名

          最新評論

          閱讀排行榜

          評論排行榜

          1.一個簡單的存儲過程
          create or replace procedure pro_sample(
              i_number1 
          in number default 0,
              i_number2 
          in number default 0,
              o_result out 
          varchar2)
          is
              i_result 
          number;
          begin
              i_result :
          = i_number1 / i_number2;
              o_result :
          = i_number1||'/'||i_number2||'='||i_result;
              exception
                  
          when others then
                      o_result:
          ='除數不能為0';
          end pro_sample;


          2.調試
          如果plsql develope 工具調試存儲時  始終是灰色,請考慮,本用戶是否有調試存儲的權限.
          如果沒有權限請執行以下sql語句
          GRANT debug any procedure, debug connect session TO test;

          3.plssql的一些總結
          1).流程控制1
            if 條件 then
               執行語句
            else if 條件 then
               執行語句
            else if 條件  then
              執行語句
            else
              執行語句
            end if;
          2).流程控制2
             1.case 檢測
                case 檢測表達式
                    when  value1 then
                        執行語句
                    when value2 then
                       執行語句
                    else
                        執行語句
               end case;
             2.case 搜索式
                case
                    when  條件1 then
                        執行語句
                    when 條件2 then
                        執行語句
                    when 條件2 then
                       執行語句
                    else
                       執行語句
                 end case  
          3).循環
             1. 簡單循環
              loop 
                執行語句
              exite when 條件
             end loop;

             2.while 循環
              while 條件 loop
                 執行語句
               end loop;

             3.for in循環
               for  變量  in  下限..上限 loop
                  執行語句
               end loop;
                
             

          posted on 2011-07-06 16:00 HUIKK 閱讀(2206) 評論(0)  編輯  收藏 所屬分類: DataBase
          主站蜘蛛池模板: 汨罗市| 烟台市| 思茅市| 双江| 固安县| 阿瓦提县| 嘉黎县| 苍山县| 太白县| 宜黄县| 宜都市| 清镇市| 漾濞| 敖汉旗| 云和县| 庆安县| 吕梁市| 佳木斯市| 大洼县| 吐鲁番市| 米泉市| 长武县| 吴川市| 衡南县| 梨树县| 南开区| 田东县| 宜丰县| 综艺| 香格里拉县| 山西省| 西宁市| 武陟县| 乃东县| 桦甸市| 招远市| 威远县| 绥阳县| 镇坪县| 甘孜| 九龙城区|