可以多个啊,只要定义OUT类型的参数就可以了

解决方案 »

  1.   

    如果输出多个值,用过程来执行.定义out参数就可以了. 至于说返回那种类型,都是一样的意思.
    create or replace procedure pro_test
    (
        p_id in number,
        p_name out varchar2,
        p_name1 out varchar2
    ) as begin 
        select t.name into p_name from tablename t where t.id=p_id;
        select 'name' into p_name1 from dual;
        .....
    end ;
      

  2.   

    不好意思,可能是我的意思沒有表達清楚,是輸入一個seal_no_,輸出一個export_no_ 但是export_no_有多個值。
      

  3.   

    CREATE FUNCTION StockPivot(seal_no In Varchar2) RETURN TickerTypeSet PIPELINED 
    IS
      out_rec TickerType := TickerType(NULL,NULL,NULL);
      in_rec tableName%ROWTYPE;
      Cursor p is Select * From tablename Where seal_no=seal_no;
    BEGIN
      LOOP
    -- Function accepts multiple rows through a REF CURSOR argument.
        FETCH p INTO in_rec;
        EXIT WHEN p%NOTFOUND;
    -- Return value is a record type that matches the table definition.
        out_rec.seal_no := in_rec.seal_no;
        out_rec.seal_Type := in_rec.seal_type;
        out_rec.seal := in_rec.seal;
    -- Once a result row is ready, we send it back to the calling program,
    -- and continue processing.
        PIPE ROW(out_rec);
      END LOOP;
      CLOSE p;
    -- The function ends with a RETURN statement that does not specify any value.
      RETURN;
    END;
    /SELECT * FROM TABLE(StockPivot('1'));
      

  4.   

    create or replace type mytabletype as table of number;
    /
    create or replace function testrerecordnotabname (tableid in number)
      return mytabletype
      as
        l_data mytabletype :=mytabletype();
      begin
        for i in (select * from a where id>=tableid)  loop
          l_data.extend;
          l_data(l_data.count) := myobjectype(i.id,i.doctime,i.name);
        end loop;  
        return l_data;     
      end;   
     /
    --调用:
    select * from table(testrerecordnotabname(1));
      

  5.   

    樓上的各位大蝦,我試了一下你們的方法,還是不行啊,能不能再具體一點啊,我的SELECT語句是:   SELECT a.export_form_no    
    FROM  CUSTOMS_EXPORT_FORM_TAB  a,CUSTOMS_SEAL_TAB  b
    WHERE a.seal_no=b.seal_no 
    AND a.seal_no=seal_no_;謝謝了,幫幫我這樣菜的菜鳥!!!!
      

  6.   

    create or replace type mytabletype as table of number;
    /
    create or replace function testrerecordnotabname (seal_no_ in number)
      return mytabletype
      as
        l_data mytabletype :=mytabletype();
      begin
        for i in (SELECT a.export_form_no FROM  CUSTOMS_EXPORT_FORM_TAB  a,CUSTOMS_SEAL_TAB  b
    WHERE a.seal_no=b.seal_no AND a.seal_no=seal_no_)  loop
          l_data.extend;
          l_data(l_data.count) := myobjectype(i.export_form_no);
        end loop;  
        return l_data;     
      end;   
     /
    --调用:
    select * from table(testrerecordnotabname(输入某个seal_no_的值));