I am trying to create a simple insert trigger from Products table to ProductPrice table, the sql fails with no error message:
CREATE TRIGGER productTrigger AFTER INSERT ON Products
FOR EACH ROW
BEGIN
INSERT INTO ProductPriceHistory (CURRENT_DATE(), CURRENT_USER(), productCode, productName, productLine, productVendor, quantityInStock, buyPrice)
VALUES (productCode, productName, productLine, productVendor, quantityInStock, buyPrice);
END
To reference values from the newly inserted line, use the NEW keyword, and use the function calls as values, not as column names;