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: TYPES.CURSORTYPE DECLARATION ERROR

Re: TYPES.CURSORTYPE DECLARATION ERROR

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Fri, 25 Jun 1999 11:42:38 GMT
Message-ID: <377a6a87.61928258@newshost.us.oracle.com>


A copy of this was sent to ggarrison <ggarrisonsr_at_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                   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 25 1999 - 06:42:38 CDT

Original text of this message

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