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 |
What is the order of defining local variables and sub procedures/functions?
How to display employee records who gets more salary than the average salary in the department?
can u plz provide me oca sql dumps please i need them
Can you use a commit statement within a database trigger?
What is a proxy object?
What is the meaning of recursive hints in oracle?
How to view the dropped tables in your recycle bin?
How can we delete duplicate rows in a table?
Table1- have two column filename data AFGDFD-20112011 hi how r u bsdasd-23042011 name shoud be in bold Now i want output like filename data AFGDFD hi how r u bsdasd name shoud be in bold Kindly answer this
In SAP ECC 6.0 , under DB02 tcode , Tablespace name to be explain stepy step all the col
What is index-organized table in Oracle?
WHT ARE THE AGGREATE FUNCTIONS?