在SQL中調用的 function, 參數一定要是數據庫的類型, 不能用 PL/SQL 類型. 還有, 只能用 IN 參數, 不能用 OUT.
------------
以前看的资料。

解决方案 »

  1.   

    open CUR_OUT for
    select Szqs('3','4') from Wq_Wqsinf_b;
    改成
    tempVar=Szqs('3','4');
    open CUR_OUT for
    select tempVar from Wq_Wqsinf_b;(tempVar是声明varchar2的变量)
      

  2.   

    对楼主发生这个错误十分奇怪~ 因为查到的资料显示,你的szqs没啥问题啊PLS-00231 function 'string' may not be used in SQL
    Cause: A proscribed function was used in a SQL statement. Certain functions
    such as SQLCODE and SQLERRM can be used only in procedural statements.
    Action: Remove the function call from the SQL statement. Or, replace the
    function call with a local variable. For example, the following statement is
    illegal:
    INSERT INTO errors VALUES (SQLCODE, SQLERRM);
    However, you can assign the values of SQLCODE and SQLERRM to local
    variables, then use the variables in the SQL statement, as follows:
    err_num := SQLCODE;
    err_msg := SQLERRM;
    INSERT INTO errors VALUES (err_num, err_msg);
      

  3.   

    阁下的语法我就不检查了.按照你的意思来处理就不会有任何的问题.
    关键是procedure getPjtjxxList(CUR_OUT OUT cur_OUT),这里cur_out是什么东西,如果这样写,则必须在oracle中定义这个类型,或者你这个过程是一个包中过程,你已经在包中定义了cur_out.
    给你一个最为简单的例子。create or replace function f_sex(a in integer,b in integer)
     return integer
     is
     
     begin
       return power(a,b);
     end;create or replace procedure p_outcur(r out sys_refcursor)
    is
      rs sys_refcursor;
    begin
      open rs for select f_sex(2,rownum) from tab;
      r:=rs;
    end;-- Created on 2006-7-26 
    declare 
      r sys_refcursor;
      tn tab.tname%type;
    begin
      -- Test statements here
      p_outcur(r);
      
      fetch r into tn;
      while (r%found) loop
         dbms_output.put_line(tn);
         fetch r into tn;
      end loop;
      close r;
    end;------
    注释:sys_refcursor是9i2种存在的系统已经定义的类型,我不知道9i1以下(包括9i1)有没有
      

  4.   

    当然取决于你的tab有多少。建议不要太多,否则power会导致溢出的。