Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/03/2013, 11:26
barchero
Invitado
 
Mensajes: n/a
Puntos:
cambio del valor de una variable de un type desde una función

Hola a todos, me encuentro con el siguiente codigo:

Código:
CREATE OR REPLACE TYPE alumnos_t UNDER persona_t(
horas NUMBER,
empresa ref empresa_t,
MEMBER FUNCTION restarHoras(h in number) RETURN NUMBER
);

CREATE OR REPLACE TYPE BODY alumnos_t AS
  MEMBER FUNCTION restarHoras(h in number) return number is begin
    SELF.horas := SELF.horas-h;
    return SELF.horas;
  END restarHoras;
END;
y me retorna este error:

Código:
Error(3,10): PLS-00363: expression 'SELF.HORAS' cannot be used as an assignment target
Mi intención es modificar la variable horas desde la funcion restarHoras, es eso posible?

Gràcias