Triggers and "FOR EACH ROW"
am 13.07.2010 11:37:22 von Rakotomandimby Mihamina
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"?
Misaotra, Thanks, Merci.
--
Architecte Informatique chez Blueline/Gulfsat:
Administration Systeme, Recherche & Developpement
+261 34 56 000 19
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org
Re: Triggers and "FOR EACH ROW"
am 13.07.2010 13:15:25 von Martijn Tonies
> 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
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org