Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> PLS-00201 when compiling function with cursor as parameter
I am trying ot use table functions for the first time so i'm not too
sure if i'm doing this all wrong anyway.
I have created a ref cursor in a package. Then i have a script to create a function that will use that cursor as an IN parameter (to eventually be called in some SQL)
the package created fine
when i try and compile the function I get a PLS-20001. I have googled around and the only suggestion i have seen that seems to fit is that the pl/sql engine/parser sometimes lags behind the sql engine. But I dont really know what this means or how to get the pl/sql engine to catch up.
I am using the same user to run these scripts and I can see the types/package when i query user_objects.
What exactly am i doing wrong?
my (trimmed) code is copied below (excuse the function if it has other errors in it, but i cant get past this one to start looking at the others)
CREATE OR REPLACE PACKAGE pkg_test IS
END;
/
CREATE OR REPLACE FUNCTION cursor_function (p_dept_cur IN pkg_test.dept_cur_type) RETURN emp_details_table_type IS
emp_details_table emp_details_table_type; dept_rec p_dept_cur%ROWTYPE;
BEGIN
LOOP
FETCH p_dept_cur INTO dept_rec;
EXIT WHEN p_dept_cur%NOTFOUND;
END LOOP; RETURN emp_details_table;
END;
/
Received on Fri Jan 20 2006 - 15:43:03 CST
![]() |
![]() |