How to call the function and Procedure in trigger?

Answer Posted / pranabesh

Procedures can be called directly by name with parameters
[if any] in the trigger

ex:
suppose i have a procedure pro1(var1 in number, var2 in
number) which i want to call from trigger trig1

CREATE OR REPLACE TRIGGER TRIG1
AFTER UPDATE OF SAL ON EMP
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE

L_VAR1 NUMBER;
...
...
BEGIN
...
...
-- CALLING THE PROCEDURE

pro1(10,20);
END

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to fetch alternate records from a table?

864


Is crud a cuss word?

775


What is implicit cursor in pl sql?

738


Is it possible to Restore a Dropped Table using Rollback Command in Oracle SQL Plus ?

933


How consistent is the view of the data between and within multiple sessions, transactions or statements ?

1919






how are mysql timestamps seen to a user? : Sql dba

771


What are few of the schema objects that are created using PL/SQL?

733


Can we have two clustered index on a table?

759


What is the use of sqldataadapter?

701


define sql update statement ? : Sql dba

806


how to enter characters as hex numbers? : Sql dba

745


How to generate a salary slip like jan 1000 1000 feb 1000 2000 ... dec 1000 12000

1890


What is a pdo connection?

682


Why are cursors used?

788


How we can create a table in pl/sql block. Insert records into it? Is it possible by some procedure or function? Please give example?

758