MySQL Forums
Forum List  »  Triggers

Re: Problem with trigger
Posted by: Peter Brawley
Date: February 01, 2018 11:25AM

> CREATE TRIGGER Tpago BEFORE UPDATE on alumnos.deuda

Trigger must be defined on the table whose Update event fires it: ON alumnos

You need to re-read the manual page on Triggers.

> > UPDATE `alumnos` set `deuda` = OLD.deuda - NEW.deuda where `alumnos`.`a` = OLD.a;

Makes no sense. What, in plain English, do you want the Trigger to do?



Edited 1 time(s). Last edit at 02/01/2018 11:26AM by Peter Brawley.

Options: ReplyQuote


Subject
Views
Written By
Posted
267
February 01, 2018 11:09AM
Re: Problem with trigger
141
February 01, 2018 11:25AM


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.