Hi,
I'm trying to create and compile some triggers in sql*plus but I think I've been given incorrect information on how to compile them. I type EDIT insert_derive_duration and an editor came up which I used to create the following:
Now when I have saved (as insert_derive_duration.sql) I'm currently doing @insert_derive_duration and expected to receive the message Trigger created but instead it does nothing. Does anyone know how I go about compiling and running my trigger please ?
Thanks in advance.
I'm trying to create and compile some triggers in sql*plus but I think I've been given incorrect information on how to compile them. I type EDIT insert_derive_duration and an editor came up which I used to create the following:
Code:
CREATE OR REPLACE TRIGGER insert_derive_duration
AFTER INSERT
OF date_to, date_from
ON contractinfo
FOR EACH ROW
DECLARE
totalDuration NUMBER := 0;
BEGIN
totalDuration := date_to - date_from;
DBMS-OUTPUT.PUTLINE(totalDuration);
END;
Thanks in advance.