Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Can we call a trigger inside a function and function inside a
trigger? Give example.

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to invoke the data pump import utility?

1165


i wrote a pl/sql procedure. it must run every sunday 4.40 How can i schedule it with the help of dbms_jobs (or another other procedure with out creating bat file,exe file)

2322


What is tns service name?

1126


What are the different windows events activated at runtime ?

2900


hello friends Im doing my final year engineering in B.Tech.. one of uncle said he can provide job in his company if im good in database management. but i have only basic knowledge about database, so like to join database management course in good intuition. so friends kindly help me to get good intuition because its my future.

2265


State any two functions of oracle?

1046


How do you bind variables in oracle?

980


What is a schema in oracle?

1014


Is it possible to set second Primary Key Constraint in a table in Oracle Database ?

1147


Is it possible to insert comments into sql statements return in the data model editor ?

2560


List the parts of a database trigger.

1052


Explain the difference between a procedure and a function?

1172


WHAT IS ecc 6.0

2148


What is pragma autonomous transaction in oracle?

1070


WHEN CURSOR MOVES FROM ONE FORM TO ANOTHER FORM, HOW MANY TRIGGER WILL BE FIRED AND WHAT ARE THEIR SEQUENCE?

2314