0
I tried to create the Trigger below in phpMyAdmin, but returns the following error:
Messages from Mysql :
1064 - You have a syntax error in your SQL next to '' on line 4
Someone’s been through it or would know to help me?
create trigger trg_pagamento before insert on entrega
for each row
begin
declare pagto int DEFAULT 0;
select p.cod_status
into pagto
from pagamento p
where p.cod_pedido = new.cod_pedido;
if pagto != 3 then
null;
end if;
end;
if you are doing something? seems to me meaningless, and can still give error
– Ricardo Pontual
what is the version of mysql?
– Rafa C.
if would not perform the insertion in the table..... is mysql 5.7
– Thainnara Santos