Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: cursor in function

Re: cursor in function

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Fri, 11 Jun 1999 17:06:33 GMT
Message-ID: <376341f6.6676310@newshost.us.oracle.com>


A copy of this was sent to Dan Hess <dah23_at_cornell.edu> (if that email address didn't require changing) On Fri, 11 Jun 1999 11:47:01 -0400, you wrote:

>with the following code,
>
>create or replace function opendir(did in integer, uid in integer)
>return
>types.cursortype
>as dir_cursor types.cursortype;
>
>begin
>
>open dir_cursor for select filename, filetype, filesize, description,
>downloads from files, ug
>
>where
>
> files.parent = did
> and ( files.groupid in
> (select ug.groupid
> from ug
> where ug.userid = uid and gstatus = 0)
> or files.permission > 1 )
>order by directory, filename;
>
>return dir_cursor;
>
>end;
>/
>
>----------------------------
>I get the error
>
>0/0 PL/SQL: Compilation unit analysis terminated
>1/57 PLS-00201: identifier 'TYPES.CURSORTYPE' must be declared
>
>Where do i need to declare this?
>
>Thanks a lot, Dan

you need to have a package called TYPES witha a type defined in it called cursortype. for example:

create package types
as

    type cursortype is ref cursor;
end;
/

See http://www.oracle.com/ideveloper/ for my column 'Digging-in to Oracle8i'... Mirrored (and more current) at http://govt.us.oracle.com/~tkyte/

Current article is "Fine Grained Access Control", added June 8'th  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA
--
Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Fri Jun 11 1999 - 12:06:33 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US