PL SQL trigger using raise_application_error thows error.

前端 未结 2 1076
难免孤独
难免孤独 2021-01-24 05:50

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 replac         


        
2条回答
  •  再見小時候
    2021-01-24 06:31

    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.

    create or replace trigger minimumwage
      before insert or update on Employee
      for each row
    begin
      if :new.Wage < 7.25 
      then 
        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.

提交回复
热议问题