exercício de trigger

0 views
Skip to first unread message

Profa. Simone Cristina Aléssio

unread,
Dec 6, 2013, 12:04:39 PM12/6/13
to geracaot...@googlegroups.com


create or replace trigger r_produto_01
  before insert or update or delete on produto  
  for each row
declare
  -- local variables here
begin
  
     if inserting then
        if :new.vlr_unit < 150 then
           raise_application_error(-20500,'Não é permitido valor inferior a 150,00!');
        end if;
     elsif updating then
        if :new.vlr_unit < 130 then
           raise_application_error(-20500,'Não é permitido alterar para valor inferior a 130,00!');
        end if;
     elsif deleting then
          raise_application_error(-20500,'Não é permitido deletar registros na tabela de produto');
     end if;
        
        end r_produto_01;

______________________________________
Profa: Simone Cristina Aléssio
Administração - Sistemas de Informação
Reply all
Reply to author
Forward
0 new messages