Can we call a trigger inside a function and function inside a
trigger? Give example.
Answer / manikandan. s
triggers can't be called. They will be fired automatically
during certain operations like insert, delete, etc..
Inside a trigger we can call function
Ex
CREATE OR REPLACE FUNCTION f_t RETURN NUMBER IS
tmpVar NUMBER;
BEGIN
select sum(col2) into tmpVar from t;
RETURN tmpVar;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
RAISE;
END f_t;
/
CREATE OR REPLACE TRIGGER L4OC.T_T
AFTER INSERT
ON L4OC.T
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
declare
tmpvar number;
begin
select f_t into tmpvar from dual;
insert into t_t values(:old.col1, tmpvar);
end;
/
Is This Answer Correct ? | 9 Yes | 5 No |
can we insert any row to dual table if i got the permission from DBA
What are the differences between char and varchar2 in oracle?
can any one help me with import/export options in oracle............
How would you best determine why your MVIEW couldnt FAST REFRESH?
How remove data files before opening a database?
What are oracle functions?
What is difference between a formal and an actual parameter?
What is a private synonym?
Who i will insert 1 lacks record in a Database table
How to update values on multiple rows in oracle?
Explain oracle’s system global area (sga).
9)When information has to be stored w.r.t employees and their respective departments, which of the following is the Correct formulation of entries? A)Employee and department would together be represented as an entity. B)This is too less information to decide on entities. C)An employee would be one entity and a department would be another. D)Such a scenario cannot be modelled in RDBMS