Skip to content Skip to sidebar Skip to footer

Pl Sql Trigger Using Raise_application_error Thows Error.

I have a few things of code I need help debugging but I feel that if I can get one of them running i'll be able to get the rest(oh how i hope). create or replace trigger minimumwa

Solution 1:

When you're getting an error, it's always helpful to specify what error. There is a syntax error in the raise_application_error call in your trigger. That procedure takes two arguments, a number and a string. You are passing in a single argument that is one long string.

createor replace trigger minimumwage
  before insertorupdateon Employee
  foreachrowbegin
  if :new.Wage <7.25then 
    raise_application_error(-20000,'Pay is below Texas minimum wage!');
  end if;
end;

should be valid assuming there is a WAGE column in your EMPLOYEE table.

Solution 2:

createor replace trigger deny_dec_pu before updateof PU on ARTICLE
 foreachrowdeclare     
 erreur_pu exception;
  begin*insertinto erreur values ('Operation de MAJ',sysdate);*-- this intruction is never executec why ?          

  if (:new.pu < :old.pu) then
  raise erreur_pu ; 
 end if;
 exception 
 when erreur_pu then 
  Raise_application_error(-20100, 'rrrrrrrr', FALSE); 

 end;

/

Post a Comment for "Pl Sql Trigger Using Raise_application_error Thows Error."