MySQL Forums
Forum List  »  Triggers

Creating a payroll profile out of a new employee record
Posted by: Jack Luk
Date: September 22, 2012 03:22AM

Structure:
employee - employee_id, employee_name, pin_no
payroll - employee_id, pay_period, gross_income
-- Trigger DDL Statements
DELIMITER $$

USE `edica`$$
CREATE TRIGGER CreatePayrollProfile
   AFTER INSERT ON employee
   FOR EACH STATEMENT
     INSERT INTO payroll
         VALUES (employee.employee_id,
                 '2012-2-30',
                 '0.00');

There is an error on FOR EACH STATEMENT. Just a red cross on the left.
And If I want to trace the pay_period, do I open up another table containing this info driven by the user?
Thanks
Jack

Options: ReplyQuote


Subject
Views
Written By
Posted
Creating a payroll profile out of a new employee record
3098
September 22, 2012 03:22AM


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.