MySQL Forums
Forum List  »  MySQL Workbench

Trigger
Posted by: Ashique Sheikh
Date: January 28, 2014 04:42AM

This is MY table Schema
INSERT INTO `trigger`.`new_table`
(`id`,
`NAME`,
`Age`,
`ADDRESS`,
`SALARY`)
VALUES
(
'3',
'Abhay',
'29',
'Ranchi',
'50'
);

I want to add this tigger on my table.

CREATE TRIGGER new_table
BEFORE INSERT ON new_table
FOR EACH ROW
BEGIN
DECLARE sal varchar(45)

value sal = (NEW.SALARY - SALARY);
Select ('Old salary: ' || OLD.salary);
Select ('New salary: ' || NEW.salary);
select ('Salary difference: ' || sal_diff);
END;

How can i do it ?
Please Help


Thanks in Advance

Options: ReplyQuote


Subject
Views
Written By
Posted
Trigger
1025
January 28, 2014 04:42AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.