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 |
How do we get field detail of a table?
How are extents allocated to a segment?
State all possible different index configurations a table can possibly have?
Explain the use of compress option in exp command.
Is oracle a programming language?
how to store only time in a data base table
can we pass two out parameters at a time in function?please answer to my question
What are the different types of databases?
How to write date and time interval literals in oracle?
what is the use of ondelete cascade?
i must get table name, constraint type, constrain name with using concads "||" and it must be in string type, then with join processes i need code please help immidiately
How to delete an existing row from a table in oracle?