I have create a type using the following SQL :
create or replace TYPE RC_SYSTEM_CODES IS REF CURSOR RETURN SYSTEM_CODES%ROWTYPE;
then I am trying to create a function using this :
CREATE OR REPLACE FUNCTION uf_myfun(INP VARCHAR2)
RETURN RC_SYSTEM_CODES
AS
rc RC_SYSTEM_CODES;
BEGIN
OPEN rc FOR SELECT * FROM SYSTEM_CODES WHERE ROWNUM<10;
RETURN rc;
END;
however during compile it gives the following :
PLS-00905: object RC_SYSTEM_CODES is invalid
What is wrong with this function and how do I use it once created ?
Thanks
create or replace TYPE RC_SYSTEM_CODES IS REF CURSOR RETURN SYSTEM_CODES%ROWTYPE;
then I am trying to create a function using this :
CREATE OR REPLACE FUNCTION uf_myfun(INP VARCHAR2)
RETURN RC_SYSTEM_CODES
AS
rc RC_SYSTEM_CODES;
BEGIN
OPEN rc FOR SELECT * FROM SYSTEM_CODES WHERE ROWNUM<10;
RETURN rc;
END;
however during compile it gives the following :
PLS-00905: object RC_SYSTEM_CODES is invalid
What is wrong with this function and how do I use it once created ?
Thanks