Home » SQL & PL/SQL » SQL & PL/SQL » calling stored procedures in a trigger.
calling stored procedures in a trigger. [message #10620] Tue, 03 February 2004 23:36 Go to next message
Jeffrey
Messages: 30
Registered: January 2003
Member
I have written a stored procedure in Oracle 9i. SO how do i call a stored procedure inside a trigger.

i have written:

CREATE OR REPLACE TRIGGER TR_BDY BEFORE
INSERT ON TESTBDY FOR EACH ROW begin
execute UPDATE_BDY_MI('TESTBDY');
end;

and i get the error:

PLS-00103: Encountered the symbol "UPDATE_BDY_MI" when expecting one of the following: := . ( @ % ; immediate The symbol ":=" was substituted for "UPDATE_BDY_MI" to continue.

Could someone help me?
Re: calling stored procedures in a trigger. [message #10621 is a reply to message #10620] Wed, 04 February 2004 01:25 Go to previous messageGo to next message
VS
Messages: 9
Registered: March 2000
Junior Member
remove 'execute' just type in UPDATE_BDY_MI('TESTBDY');
Re: calling stored procedures in a trigger. [message #10622 is a reply to message #10620] Wed, 04 February 2004 01:25 Go to previous message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Loose the "execute". That's not a PL/SQL keyword:
CREATE OR REPLACE TRIGGER TR_BDY 
  BEFORE INSERT ON TESTBDY 
  FOR EACH ROW 
begin
 UPDATE_BDY_MI('TESTBDY');
end;
MHE
Previous Topic: Line Split
Next Topic: Difference between Insert with val and Insert with select *
Goto Forum:
  


Current Time: Thu Mar 28 05:24:04 CDT 2024