try thisDECLAER
  2    num1 NUMBER;
  3    num2 NUMBER;
  4    quo  NUMBER;
  5  BEGIN
  6    num1:=5;
  7    num2:=0;
  8    quo:=num1/num2;
  9  EXCEPTION
 10    WHEN ZERO_DIVIDE THEN
 11      DBMS_OUTPUT.PUT_LINE('Didn''t your mother tell you not to
 12       DIVIDE BY ZERO!');
 13* END;

解决方案 »

  1.   

    1  declare
     2    num1 NUMBER;
     3    num2 NUMBER;
     4    quo  NUMBER;
     5  BEGIN
     6    num1:=5;
     7    num2:=0;
     8    quo:=num1/num2;
     9  EXCEPTION
    10      WHEN ZERO_DIVIDE THEN
    11      DBMS_OUTPUT.PUT_LINE('Didn'||''''||'t your mother tell you not to DIVIDE BY ZERO!');
    12*   END;
      

  2.   

    '字符用chr(39)代替。
    或:din't用Do not。
      

  3.   

    znbalan() 是对的,'号是oracle的保留字符,你必须要转换:
    四个'代表一个'字符,例如:
    SQL> select '''' from dual;'
    -
    '
      

  4.   

    DBMS_OUTPUT.PUT_LINE('Didn''t your mother tell you not to DIVIDE BY ZERO!');
    改为:
    DBMS_OUTPUT.PUT_LINE('Didn'||chr(39)||'t your mother tell you not to DIVIDE BY ZERO!');
      

  5.   

    这样就可以了,不用太复杂。
    DBMS_OUTPUT.PUT_LINE('Didn''t your mother tell you not to DIVIDE BY ZERO!');