sql >> Base de Datos >  >> RDS >> Oracle

Oracle PL/SQL:¿Cómo DEREF de un VARRAY de REF?

el DEREF debe estar en una instrucción SQL:http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28371/adobjbas.htm#i463707

esto funciona

CREATE OR REPLACE TYPE BODY PIZ AS
  MEMBER PROCEDURE DISPLAY_LOCS IS
  x varchar2(30) ;
  BEGIN
    FOR IDX IN SELF.LOCS.FIRST..SELF.LOCS.LAST LOOP
        select DEREF(SELF.LOCS(IDX)).GET_NAME() into x from dual ;
      DBMS_OUTPUT.PUT_LINE(x); --this is the line that generates the error
    END LOOP;
  END;
END;
/

buen caso de prueba para reproducir!