隨筆 - 79  文章 - 11  trackbacks - 0
          <2009年3月>
          22232425262728
          1234567
          891011121314
          15161718192021
          22232425262728
          2930311234

          不再墮落。
          Oracle documents: 
          http://tahiti.oracle.com/

          常用鏈接

          留言簿

          隨筆分類(66)

          隨筆檔案(79)

          相冊

          收藏夾(11)

          搜索

          •  

          積分與排名

          • 積分 - 53559
          • 排名 - 949

          最新隨筆

          最新評論

          閱讀排行榜

          SET SERVEROUTPUT ON;

          DECLARE
             stock_price 
          NUMBER := 9.73;
             net_earnings 
          NUMBER := 0;
             pe_ratio 
          NUMBER;
          BEGIN
          -- Calculation might cause division-by-zero error.
             pe_ratio := stock_price / net_earnings;
             dbms_output.put_line(
          'Price/earnings ratio = ' || pe_ratio);

          EXCEPTION  
          -- exception handlers begin

          -- Only one of the WHEN blocks is executed.

             
          WHEN ZERO_DIVIDE THEN  -- handles 'division by zero' error
                dbms_output.put_line('Company must have had zero earnings.');
                pe_ratio :
          = null;

             
          WHEN OTHERS THEN  -- handles all other errors
                dbms_output.put_line('Some other kind of error occurred.');
                pe_ratio :
          = null;

          END;  -- exception handlers and block end here
          /
          ref : http://www.sc.ehu.es/siwebso/KZCC/Oracle_10g_Documentacion/appdev.101/b10807/07_errs.htm
          posted on 2009-03-25 10:52 donnie 閱讀(104) 評論(0)  編輯  收藏 所屬分類: database
          主站蜘蛛池模板: 龙南县| 怀来县| 天水市| 常德市| 湘潭县| 师宗县| 凉城县| 富裕县| 冀州市| 柳河县| 涞水县| 固安县| 鹤庆县| 平潭县| 上蔡县| 龙岩市| 叶城县| 柳江县| 合肥市| 资中县| 凤城市| 田阳县| 华池县| 涟水县| 潜江市| 普洱| 石首市| 航空| 阿鲁科尔沁旗| 呼伦贝尔市| 牟定县| 韩城市| 伊通| 西藏| 金沙县| 云浮市| 象山县| 醴陵市| 兰考县| 大同市| 育儿|