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

Home -> Community -> Mailing Lists -> Oracle-L -> [Doubt] - Returning Type Table

[Doubt] - Returning Type Table

From: Eriovaldo do Carmo Andrietta <eca_at_widesoft.com.br>
Date: Mon, 19 Feb 2001 07:56:32 -0800
Message-ID: <F001.002B7E0D.20010219072523@fatcity.com>

 

Hi Friends :
 

I have the code bellow and would like to return the variable type table.
 
 

CREATE OR REPLACE PACKAGE cv_types AS   TYPE DeptCurType is REF CURSOR RETURN dept%ROWTYPE;   TYPE retorno IS TABLE OF SCOTT.dept%ROWTYPE    INDEX BY BINARY_INTEGER;   TYPE Tipo_Tabela_Emp  IS TABLE OF EMP%ROWTYPE  INDEX BY BINARY_INTEGER;   TYPE Tipo_Tabela_Dept IS TABLE OF DEPT%ROWTYPE INDEX BY BINARY_INTEGER;END cv_types;
 

create or replace function
rtc_dept    RETURN cv_types.Tipo_Tabela_DeptIScursor resultset is select * from dept;tabdept   cv_types.Tipo_tabela_Dept;I BINARY_INTEGER;tab  dept%rowtype;   BEGIN    i :=

1;    open resultset;    
loop        fetch resultset into 
tab;        exit when 

resultset%notfound;       
tabdept(i).dname :=   '- ' ||
tab.dname;        dbms_output.put_line
(tabdept(i).dname);        i := i +
1;    end loop;    close
resultset;    RETURN(tabdept);END;
scott> scott> scott> scott>
VARIABLE rtc REFCURSORscott> EXECUTE :rtc := rtc_deptbegin :rtc := rtc_dept; end;
 

<FONT face=Arial
size=2>             
*ERROR at line 1:ORA-06550: line 1, column 15:PLS-00382: expression is of wrong typeORA-06550: line 1, column 7:PL/SQL: Statement ignored
 

scott> PRINT rtcERROR:ORA-24338:
statement handle not executed
 

Error printing variable "rtc"scott>

 

what is wrong ?
 

Eriovaldo do Carmo Andrietta
Widesoft Sistemas Ltda.Limeira/SP - Brasil Received on Mon Feb 19 2001 - 09:56:32 CST

Original text of this message

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