Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Executing stored procedure within trigger

Re: Executing stored procedure within trigger

From: Robert W. Swisshelm <swisshelm_at_lilly.com>
Date: 1997/07/28
Message-ID: <33DCBCC2.203C@lilly.com>#1/1

Jeff Barnett wrote:
>
> I've create & compiled a stored procedure in 7.1.5 successfully as well
> as granted access to public. I'm now wanting to call that procedure
> from within a trigger. Below is the script for creating the trigger.
>
> *****
> CREATE OR REPLACE TRIGGER AVI_VEH_MASTER_AFT_INS
> AFTER INSERT ON AVI_VEH_MASTER
> REFERENCING NEW AS NEW OLD AS OLD
> FOR EACH ROW
> BEGIN
>
> EXECUTE ADD_COMPONENT( NEW.C_KTP_VIN );
>
> END;
> /
> *****
> When I run the script I get the following error.
>
> *****
> CREATE OR REPLACE TRIGGER AVI_VEH_MASTER_AFT_INS
> *
> ERROR at line 1:
> ORA-06550: line 6, column 12:
> PLS-00103: Encountered the symbol "ADD_COMPONENT" when expecting one of
> the
> following:
> := . ( @ % ;
> Resuming parse at line 6, column 42.
> *****
>
> I've also prefixed the owner to the beginning of the procedure and
> still no luck. If I enter the execute line of the trigger in at the
> SQLPLUS prompt it works with without any problems. Any ideas why the
> create trigger is failing?
>
> TIA
> Jeff

You only need to use 'EXECUTE' when in SQLPLUS. In PL/SQL, just enter the name of the procedure as your command.

	begin
	  ADD_COMPONENT( NEW.C_KTP_VIN );
	end;
-- 
Bob Swisshelm
Eli Lilly and Company
swisshelm_at_lilly.com
Received on Mon Jul 28 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US