MySQL Forums
Forum List  »  Triggers

Need help with my first trigger
Posted by: K W
Date: May 17, 2012 07:43AM

Hello,

I want to create a trigger and I've started with this one:

DROP TRIGGER IF EXISTS berechne_gesamtsumme;
CREATE TRIGGER  berechne_gesamtsumme
BEFORE UPDATE ON cat_spieler
FOR EACH ROW 
UPDATE cat_spieler SET gebuehr_basis = gebuehr_brunch;

The creation was successful.

In the second step I wanted to add other instructions, but it failed with adding BEGIN and END:

DROP TRIGGER IF EXISTS berechne_gesamtsumme;
CREATE TRIGGER  berechne_gesamtsumme
BEFORE UPDATE ON cat_spieler
FOR EACH ROW BEGIN
UPDATE cat_spieler SET gebuehr_basis = gebuehr_brunch;
END;

MySQL Message: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 4

What's the problem? I don't understand...

Options: ReplyQuote


Subject
Views
Written By
Posted
Need help with my first trigger
2212
K W
May 17, 2012 07:43AM


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.