自己帮助自己顶一下吧,都说Oracle好用,为什么版本之间的差距这样大

解决方案 »

  1.   

    ORA-06573: function name modifies package state, cannot be used hereCause: There are two possible causes for this message: 
    A SQL statement references a packaged PL/SQL function that does not contain a pragma containing the "Write no PackageState" (WNPS). 
    A SQL statement references a stand-alone PL/SQL function that modifies a package state. A stand-alone PL/SQL function referenced by a SQL statement cannot modify a package state. Action: If the function is a packaged PL/SQL function: recreate the function and include a pragma containing the "Write no Package State" (WNPS). 
    If the function is a stand-alone PL/SQL function: delete the function from the SQL statement. 
      

  2.   

    我最后是这样解决的:
    create or replace function trim(v_char in varchar2) return varchar2 is
      Result varchar2(2000);
    begin
      Result := rtrim(v_char);
      return(Result);
    exception
      when others then
     --   dbms_output.put_line(sqlcode);   这两句一开始是没有注释的,
     --   dbms_output.put_line(sqlerrm);      注释之后就正确了。
     NULL;
    end trim;我用的是8.0.5
      

  3.   

    包含sqlcode与sqlerrm的函数不能用在select 的语句中。
    如果你理解oracle事务的特性就知道为什么要这样。
    不能select 中出现的函数操作数据库(写数据库)(自治事务除外)
    oracle的文档也说的很清楚
      

  4.   

    另外816是有trim的,805没有,如果仅仅是出掉空格,还是建议用
    ltrim(rtrim())