写了个Fuction:    function SearchA()
    return constants.refCursor is
        v_cursor constants.refCursor;
    begin
        open v_cursor for
             SELECT 
        RETURN v_cursor;
    END;然后可不可以这样调用:select *  from SearchA where。
谢谢

解决方案 »

  1.   

    不可以这样写
    可以这样:
    SQL> create or replace function test return number is
      2  a number;
      3  begin
      4  select 1 + 1 into a from dual;
      5  return a;
      6  end;
      7  /Function createdSQL> select test() from dual where 1 <2;    TEST()
    ----------
             2
      

  2.   

    如 二楼所说不可以,因为 from 要么接表;要么视图;
      

  3.   

    建议建个临时表。
    每次清空再插入新值。
    清空用 truncate table tablename;
    避免delete太多临时数据后造成的高水位。