Good point. I think each time the trigger fires it is inserting to every column in the row. Or does the condition only insert to the fields effected. I am clueless. Thanks for any help.
Main Topics
Browse All TopicsI have a bulk load that is updating a table. there is a trigger on the table which fires and updates a "history" table in another schema.
My question is: When this trigger fires does the entire row get updated or only the where condition fields in the row?
CREATE OR REPLACE TRIGGER "U_CASHEXPECTEDENTRY"
AFTER UPDATE OF ACTGMETHOD_ID,CASHAMNT,CAS
REFERENCING OLD AS OLD NEW AS NRW
FOR EACH ROW
BEGIN
IF :NRW.REALEVENT_DTM IS NOT NULL
THEN
UPDATE "NIS1H".CASHEXPECTEDENTRY
SET
END_REALEVENT_DTM = :NRW.REALEVENT_DTM
WHERE
CASHEXPECTEDENTRY_ID=:OLD.
AND
REALEVENT_DTM = :OLD.REALEVENT_DTM AND
END_REALEVENT_DTM is NULL;
INSERT INTO "NIS1H".CASHEXPECTEDENTRY
(
ACTGMETHOD_ID,CASHAMNT,CAS
)
VALUES
(
:NRW.ACTGMETHOD_ID,:NRW.CA
);
END IF;
END;
/
SHOW ERRORS;
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Only fields listed to be updated are updated. So your trigger updates only END_REALEVENT_DTM.
For the insert - for columns listed in <columns list> INSERT INTO table (<columns list>) , corresponding values are inserted. For others, if there is default on them - it is used. For others NULL is inserted.
To gain performance maybe you could:
- disable the trigger
- run update
- update tables in the other schema
- enable the trigger
So in the example recommended above I do not have to have all the syntax after begin?
Please give me a boiler plate of this one completely so I can try it. Like I said, not experienced dba. Thanks.
CREATE OR REPLACE TRIGGER "U_CASHEXPECTEDENTRY"
AFTER UPDATE OF ACTGMETHOD_ID,CASHAMNT,CAS
REFERENCING OLD AS OLD NEW AS NRW
FOR EACH ROW
BEGIN
IF :NRW.REALEVENT_DTM IS NOT NULL
Business Accounts
Answer for Membership
by: GGuzdziolPosted on 2008-09-02 at 23:55:36ID: 22374664
Maybe you could move the condition from trigger's body to WHEN clause. It would allow you to avoid trigger's execution when NRW.REALAVENT_DTM IS NULL. So
Select allOpen in new window