Friday, April 3, 2009
Backup Stored Procedures Only
mysqldump -uusername -p -hhostname DBname --routines --no-create-info --no-data > DBName_SP.sql
Friday, March 20, 2009
Mysql error : Can't create table (errno: 121)
Thursday, January 22, 2009
Can't update table 'tbl' in stored function/trigger because it is already used by statement
create trigger DB.Trg_Upd_Sample
before update ON SDB.Test
FOR EACH ROW
BEGIN
If NEW.rowstatus = 0 Then
Update Test set new.rowstatus =1 where TestId = new.TestId;
End If ;
End ;
create trigger DB.Trg_Upd_Sample
before update ON SDB.Test
FOR EACH ROW
BEGIN
If NEW.rowstatus = 0 Then
Set New.rowstatus = 2 ;
End If ;
End ;
The OLD and NEW keywords enable you to access columns in the rows affected by a trigger. (OLD and NEW are not case sensitive.) In an INSERT trigger, only NEW.col_name can be used; there is no old row. In a DELETE trigger, only OLD.col_name can be used; there is no new row. In an UPDATE trigger, you can use OLD.col_name to refer to the columns of a row before it is updated and NEW.col_name to refer to the columns of the row after it is updated.
Franck Leveneur
GreenLit Design