Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TYPES.CURSORTYPE DECLARATION ERROR

1,408 views
Skip to first unread message

ggarrison

unread,
Jun 24, 1999, 3:00:00 AM6/24/99
to
Using PO8. This function does not compile and raises the
following errors:

FUNCTION PO8.F_TESTSELECT RETURN types.cursortype
as
l_cursor types.cursorType;

begin

open l_cursor for select ename, empno from emp order by
ename;

return l_cursor;

end;

PLS-00201: identifier 'TYPES.CURSORTYPE' must be declared
PL/SQL: Compilation unit analysis terminated

I'm assuming there is a problem with the scope of the
dbms_output package.

Any ideas - thanks in advance

**** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ****

Thomas Kyte

unread,
Jun 25, 1999, 3:00:00 AM6/25/99
to
A copy of this was sent to ggarrison <ggarr...@hotmail.com>
(if that email address didn't require changing)

On Thu, 24 Jun 1999 21:02:34 -0800, you wrote:

>Using PO8. This function does not compile and raises the
>following errors:
>
>FUNCTION PO8.F_TESTSELECT RETURN types.cursortype
>as
>l_cursor types.cursorType;
>
>begin
>
>open l_cursor for select ename, empno from emp order by
>ename;
>
>return l_cursor;
>
>end;
>
>PLS-00201: identifier 'TYPES.CURSORTYPE' must be declared
>PL/SQL: Compilation unit analysis terminated
>
>I'm assuming there is a problem with the scope of the
>dbms_output package.
>

Do you have a package types? Here is an example:

SQL> create or replace package types
2 as
3 type cursorType is ref Cursor;
4 end;
5 /

Package created.

SQL>
SQL>
SQL>
SQL> create or replace function f_testselect return types.cursorType
2 as
3 l_cursor types.cursorType;
4 begin
5 open l_cursor for select ename, empno from emp order by ename;
6 return l_cursor;
7 end;
8 /

Function created.

SQL>
SQL>
SQL> variable x refcursor
SQL>
SQL> exec :x := f_testselect

PL/SQL procedure successfully completed.

SQL>
SQL> print :x

ENAME EMPNO
---------- ----------
ADAMS 7876
ALLEN 7499
BLAKE 7698
CLARK 7782
FORD 7902
JAMES 7900
JONES 7566
KING 7839
MARTIN 7654
MILLER 7934
SCOTT 7788
SMITH 7369
TURNER 7844
WARD 7521

14 rows selected.


>Any ideas - thanks in advance
>
>
>
>
>
>**** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ****


--
See http://govt.us.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Part I of V, Autonomous Transactions" updated June 21'st

Thomas Kyte tk...@us.oracle.com
Oracle Service Industries Reston, VA USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation

0 new messages