469,322 Members | 1,084 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,322 developers. It's quick & easy.

need example for Triggers

donilourdu
hi I am doni

I need example for tigger in MySQL database.

looking for replies

with regards,
doni
Jan 12 '07 #1
4 4023
ronverdonk
4,258 Expert 4TB
In assume you do not mean TIGGERS but TRIGGERS?
What have you done to get the info from the standard MySQL documentation?That shows samples. See Triggers

You also do not specify for what situation you'd need it. Do we have to guess?

Ronald :cool:
Jan 12 '07 #2
In assume you do not mean TIGGERS but TRIGGERS?
What have you done to get the info from the standard MySQL documentation?That shows samples. See Triggers

You also do not specify for what situation you'd need it. Do we have to guess?

Ronald :cool:
thank you for reply
well Ronald I already know that site. But It cant be clear for me. Could you give me a simple example
Jan 12 '07 #3
ronverdonk
4,258 Expert 4TB
Okay, this is a simple example.
Assume: each time a row is inserted in table MyTable you want to log that event by adding a row to LogTable.
Expand|Select|Wrap|Line Numbers
  1. CREATE TRIGGER logit AFTER INSERT ON MyTable
  2. FOR EACH ROW 
  3. BEGIN
  4.   INSERT INTO LogTable (timestamp, message)
  5.   VALUES(NOW(), 'row added to MyTable');
  6. END;
  7.  
A good article with samples is shown at the OnLamp site at MySQL Triggers tryout

Ronald :cool:
Jan 12 '07 #4
[thank you Very much Ronald for your example.
It realy helpful for me.

with regards,
Doni

Okay, this is a simple example.
Assume: each time a row is inserted in table MyTable you want to log that event by adding a row to LogTable.
Expand|Select|Wrap|Line Numbers
  1. CREATE TRIGGER logit AFTER INSERT ON MyTable
  2. FOR EACH ROW 
  3. BEGIN
  4.   INSERT INTO LogTable (timestamp, message)
  5.   VALUES(NOW(), 'row added to MyTable');
  6. END;
  7.  
A good article with samples is shown at the OnLamp site at MySQL Triggers tryout

Ronald :cool:
Jan 13 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Mark Flippin | last post: by
11 posts views Thread by William Payne | last post: by
debasisdas
reply views Thread by debasisdas | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.