Re: Cannot get trigger to run correctly
The Trigger code has errors. Try ...
DELIMITER //
CREATE TRIGGER defaultinvoiceDate BEFORE INSERT ON invoiceheader FOR EACH ROW
BEGIN
SET new.invoicedate = now();
END;
//
DELIMITER ;
or simply ...
CREATE TRIGGER defaultinvoiceDate BEFORE INSERT ON invoiceheader
FOR EACH ROW SET new.invoicedate = now();
or even more simply, why not make the column TIMESTAMP DEFAULT NOW()?
PB
Subject
Views
Written By
Posted
2626
June 19, 2011 07:32PM
Re: Cannot get trigger to run correctly
1053
June 19, 2011 07:51PM
1033
June 19, 2011 08:27PM
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.