Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compiling Triggers in sql*plus

Status
Not open for further replies.

ro88o

Programmer
Jun 25, 2005
24
GB
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:
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;
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top