MySQL Forums
Forum List  »  Triggers

Error Code: 1235 This version of MySQL doesn't yet support multiple triggers with the same action time and event for one table
Posted by: Fuuryoku Chan
Date: July 24, 2013 06:55AM

I sadly discovered that my version of mysql (5.5) doesn't support multiple triggers with the same action time and event for one table.

unfortunately the case study from which they draw has different so ... being new in the world sql mysql and I stalled and I can not get out of the situation.
I can help you?

triggers are:


create trigger RA3_4
after insert on messaInScena
for each row
update messaInScena
set postiDisponibili = (select capienza
from spazio where nome = New.spazio)
where (data = New.data and
ora = New.ora, spazio = New.spazio);


create trigger RA4_1
after insert on messaInScena
for each row
update messaInScena
set New.prezzoRidotto = New.prezzoIntero * 0.8
where (data = New.data and
ora = New.ora, spazio = New.spazio);


create trigger RA4_2
after insert on messaInScena
for each row
update messaInScena
set New.prezzoStudenti = New.prezzoIntero * 0.5
where (data = New.data and
ora = New.ora, spazio = New.spazio);

create trigger RA4_3
after update of prezzoIntero on messaInScena
for each row
update messaInScena
set New.prezzoRidotto = New.prezzoIntero * 0.8
where (data = New.data and
ora = New.ora, spazio = New.spazio);


create trigger RA4_4
after update of prezzoIntero on messaInScena
for each row
update messaInScena
set New.prezzoStudenti = New.prezzoIntero * 0.5
where (data = New.data and
ora = New.ora, spazio = New.spazio);

create trigger RA5_1
after insert on prenotazione
for each row
when (tipo = "Intero")
update prenotazione
set New.prezzo = (select prezzoIntero
from messaInScena
where (data = New.dataSpettacolo and
ora = New.oraSpettacolo and
spazio = New.spazioSpettacolo))
where (dataSpettacolo = New.dataSpettacolo and
oraSpettacolo = New.oraSpettacolo and
spazioSpettacolo = New.spazioSpettacolo and
numero = New.numero);


create trigger RA5_2
after insert on prenotazione
for each row
when (tipo = "Ridotto")
update prenotazione
set New.prezzo = (select prezzoRidotto
from messaInScena
where (data = New.dataSpettacolo and
ora = New.oraSpettacolo and
spazio = New.spazioSpettacolo))
where (dataSpettacolo = New.dataSpettacolo and
oraSpettacolo = New.oraSpettacolo and
spazioSpettacolo = New.spazioSpettacolo and
numero = New.numero);


create trigger RA5_3
after insert on prenotazione
for each row
when (tipo = "Studenti")
update prenotazione
set New.prezzo = (select prezzoStudenti
from messaInScena
where (data = New.dataSpettacolo and
ora = New.oraSpettacolo and
spazio = New.spazioSpettacolo))
where (dataSpettacolo = New.dataSpettacolo and
oraSpettacolo = New.oraSpettacolo and
spazioSpettacolo = New.spazioSpettacolo and
numero = New.numero);



the last 3 puzzles me also the when ... should not be something like

CASE expression
WHEN value THEN result
ELSE risultato_default
END

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.