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 |
You create a private database link and upon connection, fails with: ORA-2085: connects to . What is the problem? How would you go about resolving this error?
What are the varoius components of physical database structure of oracle database?
What is Hash Index?
I have a table emp. There is only one column in the table. In that , there are only three rows in that column. The value in the first row is 'A' and the value in the second row is 'B' and the third row is 'C'. Now, my question is , How will you write a select query to display the output as B C A Note: order by cannot be used coz it gives us output as CBA. But the output should be BCA.
what are steps for interface? where is exchange rate defined in which table?
Explain how you would restore a database using RMAN to Point in Time?
What is snapshot is too old? Give and example for better understand.
What are a collation and state the different types of collation sensitivity?
what is partitioning? Types of partitioning. explain? what is the new kind of partitioning type introduced in 9i?
What is Undo Management Advisor in Oracle?
What is an oracle database table?
How to use values from other tables in update statements using oracle?