If you do want to recursively update the table (say you change 1 record's next_sch_yr and you want to update many rows based on the application_id) then here is a previous sample.
http://www.experts-exchang
Main Topics
Browse All TopicsI am trying to find a simple way to keep two fields the same at all times, but all the samples I come accross are more complex than what works in DB2 (we are migrating to Oracle).
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.
If you do want to recursively update the table (say you change 1 record's next_sch_yr and you want to update many rows based on the application_id) then here is a previous sample.
http://www.experts-exchang
This is for existing records only. I will need to keep both fields synchronized regardless of which one is updated.
mrjoltcola, I think you have the right idea. I should have tried that first. Except I had to put a ":" before new in the line after BEGIN.
create or replace TRIGGER TRIG_APPLICATION_NEXT_SCH_
BEFORE UPDATE OF NEXT_SCH_YR ON APPLICATION
FOR EACH ROW
WHEN (new.next_sch_yr <> new.stu_grade)
BEGIN
:new.stu_grade := :new.next_sch_yr;
END;
Business Accounts
Answer for Membership
by: mrjoltcolaPosted on 2009-06-22 at 16:04:06ID: 24687432
The question is if the new record is the only record that you wish to change, or are you trying to update other records in the APPLICATION table with the same application_id
If you only need to update the record being inserted, prior to insert, you can do a simple BEFORE INSERT or BEFORE UPDATE .. FOR EACH ROW, see below..
However, if you want a a "recursive" style update, you'll need to do it indirectly, you can't update the same table in the trigger.
Select allOpen in new window