newbie question on triggers

From: Jim Lyons <godzilla_at_seuss.cc.utexas.edu>
Date: 1995/10/24
Message-ID: <1995Oct24.104426_at_seuss.cc.utexas.edu>#1/1


I have a file which drops and then creates a trigger, call it trig.sql. The structure of trig.sql is:

	drop trigger brokertrig;
	create trigger brokertrig
	before instert
	on broker
	declare

...declarations...;
begin
...code for trigger;
end;

When I run SQL*PLUS and issue the command _at_trig, the program begins to execute ok and the trigger is dropped ok. The create trigger part begins to execute but I suddenly find myself in interactive mode. I have a line prompt (e.g. 18>), and input is expected. I've tried entering just a ';' but that didn't work. I enter a control-C to return to the 1> prompt. I then issue the RUN command. The file then executes. I'm told first that the trigger doesn't exist (because I've just dropped it) and then it creates the trigger without a problem.

What I want is for the file to execute in its entirety the first time. I've tried putting an EXIT; command at the end of trig.sql but Oracle did not like that -at all- so I took it out. Can someone help me out here?

--
Jim Lyons                     |  Operating Systems Specialist
Computation Center            |  512-475-9331
University of Texas at Austin |  godzilla_at_seuss.cc.utexas.edu
http://www.cc.utexas.edu/~godzilla/jimlyons.html
Received on Tue Oct 24 1995 - 00:00:00 CET

Original text of this message