I've some prob with the function TABLE in ORACLE.
SET SERVEROUTPUT ON SIZE 100000;
DECLARE
int_position NUMBER(20);
TYPE T_REC_EMP IS RECORD ( nameFile VARCHAR2(200) );
R_EMP T_REC_EMP ; -- variable enregistrement de type T_REC_EMP
TYPE TAB_T_REC_EMP IS TABLE OF T_REC_EMP index by binary_integer ;
t_rec TAB_T_REC_EMP ; -- variable tableau d''enregistrements
PROCEDURE Pc_Insert ( v_value IN VARCHAR2) IS
BEGIN
if t_rec.exists(t_rec.Last) then
int_position := t_rec.last;
int_position := int_position +1;
t_rec(int_position).nomFichier := v_value;
else
t_rec(1).nomFichier :=v_value;
end if;
END;
FUNCTION calice_ORACLE( n IN NUMBER) RETURN T_REC_EMP PIPELINED IS
BEGIN
FOR i in 1 .. n LOOP
PIPE ROW(t_rec(i));
END LOOP;
RETURN;
END;
BEGIN
Pc_Insert('allo1');
Pc_Insert('allo2');
Pc_Insert('allo3');
SELECT * fROM TABLE(calice_ORACLE(2));
END;
/
I'm some error about function doesn't support in SQL statement ( I'm on 9i 9.2 vr)