Converting Postgre Function to MySql
Posted by:
ayuba isa
Date: August 12, 2012 06:03AM
hi! i need help on converting this postgre function to mysql:
CREATE OR REPLACE FUNCTION ins_Periods() RETURNS trigger AS $$
BEGIN
INSERT INTO Period_Tax_Types (Period_ID, Tax_Type_ID, Period_Tax_Type_Name, Formural, tax_relief, percentage, linear, Employer, Employer_PS, Tax_Type_order, In_Tax, account_number)
SELECT NEW.Period_ID, Tax_Type_ID, Tax_Type_Name, Formural, tax_relief, percentage, linear, Employer, Employer_PS, Tax_Type_order, In_Tax, account_number
FROM Tax_Types
WHERE (active = true);
INSERT INTO Employee_Month (Period_ID, pay_group_ID, Entity_ID, Bank_Branch_ID, Department_Role_ID, Bank_Account, Basic_Pay)
SELECT NEW.Period_ID, 0, Entity_ID, Bank_Branch_ID, Department_Role_ID, Bank_Account, basic_salary
FROM Employees
WHERE (active = true);
PERFORM updTax(employee_month_id, Period_id)
FROM employee_month
WHERE (period_id = NEW.period_id);
RETURN NULL;
END;
thanks in anticipation