Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PL SQL procedure to check if there is any new record/modified existing record and update other table

HKumar679Sep 30 2016 — edited Oct 4 2016

Hi Team,

I am looking for the best and easiest way to implement the below logic using PL SQL procedure

QuestIon:-

I have a table which contains some info( name, id,desc,from_date,last_date) and I would like to write a procedure , when I run  the procedure it should check this table records and do the following:

1) If there is any new entry

  then It should be added to Table_1(id,group,date).

  AND

  Also ,new record should be inserted into Table_2('XYZ',date,id,'XWQ')

2) If there is any change in existing record fields ( from_date & last_date )

        then it should check Table_1 table for that particular record and if it doesn't exists , it should insert a new record and if not , it should ignore it.

       AND

       Also ,new record should be inserted into Table_2('0',date,id,'xxx',date,date)

Please let me know if you need any more info.

I would appreciate your help ! Thank You All !

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 1 2016
Added on Sep 30 2016
26 comments
4,269 views