I want to call store procedure from DataBase Trigger
how to call it.
i tried as following but it give me error.
For example This is my Procedure
----------------------------------
Expand|Select|Wrap|Line Numbers
- CREATE OR REPLACE PROCEDURE P1
- IS
- CURSOR C1 IS SELECT EMPNO,ENAME FROM EMP;
- V_EMPNO NUMBER;
- V_ENAME VARCHAR2(20);
- BEGIN
- OPEN C1;
- LOOP
- FETCH C1 INTO V_EMPNO,V_ENAME;
- EXIT WHEN C1%NOTFOUND;
- DBMS_OUTPUT.PUT_LINE(V_EMPNO||' '||V_ENAME);
- END LOOP;
- END;
Now I want to Execute the above procedure from Database Trigger,
when the INSERT,UPDATE or DELETE occure to the table
the above procedure should automitclly EXECUTE.
This is my trigger
Expand|Select|Wrap|Line Numbers
- CREATE OR REPLACE TRIGGER EMP_TRIG
- AFTER INSERT OR UPDATE OR DELETE ON EMP
- FOR EACH ROW
- BEGIN
- CALL P1();
- END;
it give me the following Error.
LINE/COL ERROR
-------- ------------------------------------------------
2/6 PLS-00103: Encountered the symbol "P1" when expecting one of the
following:
:= . ( @ % ;
The symbol ":=" was substituted for "P1" to continue.
--------------------------------------------------------
Thanks in Advance.
looking forword.