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

Where is the export dump file located?

1135


21. Using a set operator, display the client number of all clients who have ever placed an order and whose whose name does not contain the string Sm.

2090


Explain the characteristics of oracle dba?

1114


How to use attributes of the implicit cursor in oracle?

998


What do you mean by a database transaction & what all tcl statements are available in oracle?

988


What is materialized view in Oracle?

1067


In which language oracle has been developed?

1069


How to retrieve values from data fields in record variables?

1104


Write a trigger example in oracle?

1046


How to use group functions in the select clause using oracle?

1063


Oracle

2371


How to select an oracle system id (sid)?

1058


How to get a create statement for an existing table?

965


How do I use os authentication with weblogic jdriver for oracle and connection pools?

1042


What is an oracle transaction?

1126