Help in Trigger

Dúvidas, dicas e truques de PL/SQL. Aqui também vão assuntos relacionados a pacotes, triggers, funções, Java-Stored Procedures, etc
Post Reply
fabiopdb
Rank: Estagiário Sênior
Rank: Estagiário Sênior
Posts: 12
Joined: Wed, 22 Aug 2007 4:58 pm
Location: rio de janeiro

Friends can someone help with this trigger here ???? This is invalidated in the compilation

Select all

create or replace trigger inativar 
after update on tab_servico 
for each row 
begin 
  if inserting or updating then 
    if new.in_servico_inibido = 1 then 
    new.in_ativo := 0 
    end if 
  end if; 
end inativo; 
/
User avatar
dr_gori
Moderador
Moderador
Posts: 5024
Joined: Mon, 03 May 2004 3:08 pm
Location: Portland, OR USA
Contact:
Thomas F. G

Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered

I think the problem is that inactive end;
Take the inactive!
fabiopdb
Rank: Estagiário Sênior
Rank: Estagiário Sênior
Posts: 12
Joined: Wed, 22 Aug 2007 4:58 pm
Location: rio de janeiro

I took the inactive and still was not ...
fabiopdb
Rank: Estagiário Sênior
Rank: Estagiário Sênior
Posts: 12
Joined: Wed, 22 Aug 2007 4:58 pm
Location: rio de janeiro

Look at the error

Compilation Errors for Trigger to inactivate

Select all

Error: PLS-00103: Encontrado o símbolo "END" quando um dos seguintes símbolos era esperado:* & = - + ; < / > at in is mod remainder not rem 
<um expoente (**)> <> or != or ~= >= <= <> and or like LIKE2_ 
LIKE4_ LIKEC_ between || multiset member SUBMULTISET_ O símbolo ";" foi substituído por "END" para continuar. 
Line: 8 
Text: end if;
Trevisolli
Moderador
Moderador
Posts: 2016
Joined: Wed, 12 Jan 2005 3:25 pm
Location: Araraquara - SP
Abraço,

Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP

Brother,

The New AS Reference New and Old Old is correct?
meguelito
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 60
Joined: Tue, 17 Jan 2006 1:45 pm
Location: Santa Catarina
Att.:
Alan Juliano Metzger
Programador Oracle
Inside System Informática
Msn/E-mail: alanjuliano@yahoo.com.br

I think I found the problem missing the two points in front of the new and old.

Select all

if :new.in_servico_inibido = 1 then
And another thing try to take the point and comma from the end or leave only end but I think the problem is the two points.
fabiopdb
Rank: Estagiário Sênior
Rank: Estagiário Sênior
Posts: 12
Joined: Wed, 22 Aug 2007 4:58 pm
Location: rio de janeiro

Select all

create or replace trigger inativar 
after update on tab_servico 
for each row 
begin 
if  inserting or updating then 
if:new.in_servico_inibido = 1 then 
new.in_ativo := 0 
end if
is stopping here

Select all

 ("Compilation errors for TRIGGER ACQUA_USER.INATIVAR Error: PLS-00103: Encontrado o símbolo "END" quando um dos seguintes símbolos era esperado:* & = - + ; < / > at in is mod remainder not rem 
  (**)> <> or != or ~= >= <= <> and or like LIKE2_ LIKE4_ LIKEC_ between || multiset member SUBMULTISET_Line: 8 Text: end if")

Select all

end if 
end
fabiopdb
Rank: Estagiário Sênior
Rank: Estagiário Sênior
Posts: 12
Joined: Wed, 22 Aug 2007 4:58 pm
Location: rio de janeiro

Srs was like this:
SRS I am sending the trigger script that makes control of the fields inhibited and active:

Select all

create or replace trigger inativar 
after update on tab_servico 
REFERENCING OLD AS old NEW AS new 
for each row 
begin 
if inserting or updating then 
if:new.in_servico_inibido = 1 then 
update tab_servico set in_ativo = 0 ; 
end if; 
end if; 
end ;
User avatar
dr_gori
Moderador
Moderador
Posts: 5024
Joined: Mon, 03 May 2004 3:08 pm
Location: Portland, OR USA
Contact:
Thomas F. G

Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered

beleza, hehehe
was ; after endif -> no one saw !! :-D
Post Reply
  • Information
  • Who is online

    Users browsing this forum: Bing [Bot] and 1 guest