locked
Error trigger oracle RRS feed

  • Question

  • User-1007025539 posted

    Hi, I have the following trigger

    TRIGGER VERIF_ACTIVOS AFTER DELETE OR UPDATE OF "IDUSUARIOBAJA"
    ON ADMSAT4.AREA_CENTRO
    FOR EACH ROW
    DECLARE
       existe integer;
    BEGIN
      select count(*) INTO existe 
         FROM AREACENTRO_ACTIVO where
                    AREACENTRO_ACTIVO.IDAREA_CENTRO=:old.IDAREA_CENTRO
                    and IDUSUARIOBAJA = 0;
    IF UPDATING OR DELETING THEN
     IF (:NEW.IDUSUARIOBAJA <> 0 AND existe>0) THEN
         RAISE_APPLICATION_ERROR('-20050','No puede dar de baja el área / centro por tener activos asociados');
     END IF;  
    END IF;


    END VERIF_ACTIVOS;

    When it is executed by this statement in sqldeveloper: update area_centro set idusuariobaja = 3  where idarea_centro = '161'
    it is well executed. But when I execute the same statement with the webserver .net it raises me a ORA-01001: invalid
    cursor error.

    .Net needs permissions to be able to execute the triggers?

    I don't understand that error. That is my first trigger in the application. I can execute all
    the oracle packages and statements but not the triggers.

    Thanks in advance.

    Monday, November 28, 2011 11:49 AM

All replies

  • User1927273029 posted

    Hello,

    Did you tried to create the trigger using executenonquery?

    Tuesday, November 29, 2011 4:57 AM