List:General Discussion« Previous MessageNext Message »
From:Martijn Tonies Date:July 13 2010 11:15am
Subject:Re: Triggers and "FOR EACH ROW"
View as plain text  
> Manao ahoana, Hello, Bonjour,
>
> I just read several documentation on MySQL triggers.
> The way to create triggers is:
> CREATE TRIGGER t21_au
> BEFORE UPDATE ON t22
> FOR EACH ROW
> BEGIN
> // ...
> END;
>
> The trigger I want is only on UPDATE.
>
> Is "FOR EACH ROW" referring to "each existing row in the table", or to
> "each UPDATEd row"?

Each updated row, as per documentation:

" It can be BEFORE or AFTER to indicate that the trigger activates before or 
after each row to be modified.  "

With regards,

Martijn Tonies
Upscene Productions
http://www.upscene.com

Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!

Database questions? Check the forum:
http://www.databasedevelopmentforum.com 

Thread
Triggers and "FOR EACH ROW"Mihamina Rakotomandimby13 Jul
  • Re: Triggers and "FOR EACH ROW"Martijn Tonies13 Jul