pf » Triggers in MySQL 5

Triggers in MySQL 5

databases

Peter Gulutzan shows a sneak peak of Trigger support in MySQL 5 alpha in his article MySQL Triggers Tryout on O'Reilly OnLamp.



This entry was:

Trackback Address: 211/5162A0DA3DE6A59344994E5AEF5D3397
On 08/05/2005 at 12:22:56 AM MDT Pheath Rithy wrote:
1
You sent updating in MySQL 5.x , Documentation in MySQL all version , Syntax Trigger and Path Downlaod Graphic MySQL 5.x

On 04/09/2007 at 1:26:39 AM MDT Naveen Tripathi wrote:
2
CREATE OR REPLACE TRIGGER tr_id before insert on comment for each row declare @maxid int; @mon int(2); @yr varchar(4); @finyr varchar(10); begin set mon:=to_number(to_char(:new.dt,'mm')); set yr:=to_char(:new.dt,'yy'); if mon>=4 then set finyr:=trim(yr)||'-'||trim(to_char(to_number(yr)+1,'00')); else set finyr:=to_char(to_number(yr)-1)||'-'||yr; end if; select max(comnocode) into maxid from comment; if maxid is null then set :new.compno:=1; set :new.comnocode:=finyr||'1'; else set :new.compno:=maxid+1; set :new.comnocode:='w'||trim(finyr)||'/'||trim(to_char(maxid+1,'00')); end if; end;

#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 'TRIGGER tr_id before insert on comment for each row declare set @maxid int' at line 1

On 11/05/2007 at 12:40:31 AM MST Velmurugan wrote:
3
I think CREATE or REPLACE only works in sql only




  



Spell Checker by Foundeo





Subscribe to my RSS Feed: solosub RSS
Tags