Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Function Creating Error

Status
Not open for further replies.

aahan

Programmer
Mar 28, 2002
15
US
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
 
You can not create database type REF CURSOR. You should instead declare it in some package. Your type RC_SYSTEM_CODES is invalid.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top