Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PLS-00653 error - Aggregate/Table Functions are not allowed in PL-SQL scope.

NewLearnerJun 30 2014 — edited Jun 30 2014

Hi Gurus,

CREATE GLOBAL TEMPORARY TABLE globtable (   c1 NUMBER(10,0) ,   c2 CHAR(5) ); /

CREATE OR REPLACE PACKAGE funct_pkg AS

TYPE globtable_type IS TABLE OF globtable%ROWTYPE; END;

/

CREATE OR REPLACE FUNCTION funct (   v_p1 IN NUMBER,   v_p2 IN VARCHAR2 )

RETURN funct_pkg.globtable_type PIPELINED

AS 

v_temp  SYS_REFCURSOR; 

v_temp_1 globtable%ROWTYPE;

BEGIN 

INSERT INTO globtable VALUES ( v_p1 , v_p2  ); 

OPEN v_temp FOR SELECT C1,C2 FROM globtable;         

LOOP     

FETCH v_temp INTO v_temp_1.c1,v_temp_1.C2;     

EXIT WHEN v_temp%NOTFOUND;     

PIPE ROW ( v_temp_1 ); 

END LOOP; END;

/

My oracle version is 11g. When am trying to execute am getting PLS-00653. Aggregate/Table Functions are not allowed in PL-SQL scope. I cant understand what is wrong. Pls help

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 28 2014
Added on Jun 30 2014
18 comments
5,786 views