I would like to create trigger which should create new row in table INVOICES after a new row is created in FREIGHTS table. The trigger should get value from table FREIGHTS and put it in column in table INVOICES.
For now it looks as follows:
create or replace TRIGGER NewInvoice
AFTER INSERT ON FREIGHTS
FOR EACH ROW
BEGIN
INSERT INTO INVOICES(id, netvalue, grossvalue, tax, receipient)
SELECT '1', '1', weight, '1', '1'
FROM FREIGHTS
END;
The error is at the final END statement.
Thanks in advance for your support ;)
INSERT INTO INVOICES(id, netvalue, grossvalue, tax, receipient) VALUES( '1', '1', :new.weight, '1', '1' );