Re: Defining a cursor of %TYPE rather than %ROWTYPE

From: ddf <oratune_at_msn.com>
Date: Tue, 2 Oct 2012 13:11:19 -0700 (PDT)
Message-ID: <462aad05-6cf6-4baf-b5fa-a1119f3f0064_at_googlegroups.com>



Comments embedded.

On Tuesday, October 2, 2012 11:04:22 AM UTC-6, Ian wrote:
> Hello,
>
>
>
> I have a question about cursors. I have created a simple package, package body, and procedure. Everything works fine (code to follow), my goal is to move the cursors out of the procedure and into the package body, and declare them in the package. However I have only been able to use cursors that return %ROWTYPE to declare effectively, if I use %TYPE is complains:
>
> 4/1 PL/SQL: Declaration ignored
>
> 4/32 PLS-00320: the declaration of the type of this expression is
>
> incomplete or malformed.
>

As it should; cursors return rows of data, even those that return single columns.  

> Is there a way to create a cursor that returns %TYPE, can a reference cursor be used for that?
>

No, that is not possible. Not in a currently available release of Oracle.  

>
>
> Thanks!
>

David Fitzjarrell Received on Tue Oct 02 2012 - 22:11:19 CEST

Original text of this message