Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- delimiter $
- create trigger otomatis after insert on inbox
- for each row begin
- if (select count(*) from inbox where SenderNumber=new.SenderNumber and TextDecoded=new.TextDecoded) > 1 then
- insert into outbox (DestinationNumber,TextDecoded) values (new.SenderNumber , 'Anda sudah pernah Memilih');
- elseif (select count(*) from inbox where SenderNumber=new.SenderNumber and TextDecoded=new.TextDecoded) = 1 then
- begin
- update poll set Jumlah = Jumlah + 1 where Kode=new.TextDecoded;
- insert into outbox (DestinationNumber,TextDecoded) values (new.SenderNumber , 'Terima Kasih Pilihan Anda Sudah Tersimpan');
- end;
- elseif (select count(*) from poll where Kode=new.TextDecoded) = 0 then
- insert into outbox (DestinationNumber,TextDecoded) values (new.SenderNumber , 'Pilihan anda tidak ada dalam list');
- end if;
- end $
- delimiter ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement