How do you call a function that belongs in a package?
843845Mar 8 2011 — edited Mar 8 2011Hello,
Can anyone help me with this issue? My intent is to create a procedure that returns a cursor to the results of the query without passing in the cursor to the function. After reading thru online tutorials, I found that I had to create a function, not a procedure.
I created a .sql file as such:
-----------
create or replace package GetEmployeeCursors is
type empResultSet is REF CURSOR;
function Funct1 return empResultSet;
end GetEmployeeCursors;
/
create or replace package body GetEmployeeCursors is function Funct1 return
empResultSet is
tmpResultSet empResultSet;
begin
open tmpResultSet for
select * from employee;
return tmpResultSet;
end Funct1;
end GetEmployeeCursors;
/
-----------
Both the package and package body were created without any problems.
Then, I tried to call the Funct1() in many ways, including the following:
call System.getEmployeeCursors.Funct1()
call getEmployeeCursors.Funct1()
call Funct1()
All produced the following error message:
ERROR at line 1:
ORA-06576: not a valid function or procedure name
How do I call Funct1()?
Thanks so much in advance,
--Anna