422,764 Members | 1,289 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 422,764 IT Pros & Developers. It's quick & easy.

Unable to call the Procedure inside Trigger

P: 1
I'm just a beginner in PL/SQL. I'm trying to call the TESTPROC procedure inside my TRIGGER. Here is my code:

CREATE TABLE FORTESTING
(
TestName VARCHAR(50) ,
);

CREATE OR REPLACE TRIGGER TESTTRIG
BEFORE INSERT ON FORTESTING
FOR EACH ROW
BEGIN
CALL TESTPROC();
END;
/

CREATE OR REPLACE PROCEDURE TESTPROC (name VARCHAR2)
AS
v_name FORTESTING.TestName%TYPE;

BEGIN
IF v_name := name THEN
DBMS_OUTPUT.PUT_LINE('Test Name ' || name || ' EXIST' );
END IF;
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.PUT_LINE ('Test Name ' || name || ' NOT FOUND');
END;
/

After checking the Trigger, i got the below error:
Error(2,10): PLS-00103: Encountered the symbol "TESTPROC" when expecting one of the following: := . ( @ % ; The symbol ":=" was substituted for "TESTPROC" to continue.

Can anyone tell me if my codes are correct and how to fix this error?

Thank you.
Sep 29 '17 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.