Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Error when calling a pipelined function from another function

user650888Feb 13 2014 — edited Feb 13 2014

How do I successfully call a function which returns a pipelined function from another function ?

-- my_data is a function that returns pipelined function

FUNCTION  my_data(rec IN OUT emp.employees%ROWTYPE
                    )
                     RETURN out_rows PIPELINED IS

  

BEGIN

  ---- logic to populate


            PIPE ROW (record_type);

    
  
   RETURN;
EXCEPTION
   WHEN OTHERS THEN
    
null
END my_data;

-- Below function should call the above one.

FUNCTION  function_2(rec  IN OUT emp.employees%ROWTYPE
                          ) RETURN out_rows PIPELINED
IS
 
   final_rows_v         out_rows ;

BEGIN

  select res.* BULK COLLECT INTO final_rows_v
  FROM TABLE(my_data(rec)) res;
 
  FOR i in 1..final_rows_v .COUNT LOOP
 
   PIPE ROW(final_rows_v (i));
  END LOOP;
return;
 

END function_2;

I am getting

PLS-00382: expression is of wrong type

PLS-00306: wrong number or types of arguments in call to my_data

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 13 2014
Added on Feb 13 2014
6 comments
3,444 views