How to call the function and Procedure in trigger?

Answers were Sorted based on User's Feedback



How to call the function and Procedure in trigger?..

Answer / rakesh keshu

With the help of call statement..without semicolon

create or replace trigger tri_call


begin
call p1()



end tri_call;

Is This Answer Correct ?    12 Yes 0 No

How to call the function and Procedure in trigger?..

Answer / 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

How to call the function and Procedure in trigger?..

Answer / pradeep aryan

hi this is Sql server Statement:

Create table findSalary(salay int)

-- create procedure
Create proc stp_testdata
as
begin
select * from findsalary
end
-- Create function
create function Function4()
returns varchar
as
begin
return 'test data'
end
-- insert command
insert into findsalary values (89)


this is working fine

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More SQL PLSQL Interview Questions

Which are the different types of indexes in sql?

0 Answers  


What is cursor status?

0 Answers  


What are system versioned tables?

0 Answers  


What is partition in sql query?

0 Answers  


Which command is used to call a stored procedure?

0 Answers  






How to write a single statement that concatenates the words ?hello? And ?world? And assign it in a variable named greeting?

0 Answers  


Do stored procedures prevent sql injection?

0 Answers  


Write a sql query to get the third highest salary of an employee from employee_table?

0 Answers  


How do I count records in sql?

0 Answers  


I have 2 table A and B. In A 1 lakh record is present. In b 20 thousand data is present. To get the unique data from table A and B which join we should prefer left inner join or right outer join. Please answer.

4 Answers   GE,


What is bind variable in pl sql?

0 Answers  


What are the steps for performance tuning.

0 Answers  


Categories