Trigger help [message #316686] |
Sun, 27 April 2008 18:40  |
iceluvr1089
Messages: 2 Registered: April 2008
|
Junior Member |
|
|
Hey I am trying to create a trigger for a table so that when I update or add a record on my invoice line table, it will automatically calculate the new line total. Thought I had to code right, but something is wrong. Can anyone help me?
The code for my trigger is:
CREATE OR REPLACE TRIGGER LINE_TOTAL_T
BEFORE INSERT ON LINE
FOR EACH ROW
BEGIN
NEW.LINE_TOTAL:= :NEW.LINE_UNITS * :NEW.LINE_PRICE;
END;
The errors displaying are:
LINE/COL ERROR
2/2 PL/SQL: Statement ignored
2/2 PLS-00201: identifier 'NEW.LINE_TOTAL' must be declared
Any thoughts??
Thanks!
|
|
|
|
|
Re: Trigger help [message #316723 is a reply to message #316686] |
Mon, 28 April 2008 01:15  |
dr.s.raghunathan
Messages: 540 Registered: February 2008
|
Senior Member |
|
|
hi
you want to update, whereas your before trigger do not have
update syntax it is having only insert...
or am i missing part of your code?
yours
dr.s.raghunathan
|
|
|