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!

insert history records in one table based on update of another table

Vasu bodsJun 26 2019 — edited Jul 16 2019

Hi Experts,

I have 2 tables called 1. Req and 2.Req_hist

I have a data in Req table like below

Req Table:

Req_no, Req_status, last_modified_date

1,New,2019-06-23

Req_hist table:

Req_no,Req_status,last_modified_date

1. How to load history records into Req_hist table based on Req table.

2. Whenever status changes happened in req table values should be appended in Req_hist table with the updated value.

For example:

Req Table:

Req_no, Req_status, last_modified_date

1, Offersent , 2019-06-25

Req_hist table:

Req_no,Req_status,last_modified_date

1, New, 2019-06-23

1, Offersent , 2019-06-25

How we have to write a query to handle this type of scenario.

Kindly help on this.

Thanks in Advance

Visu

Comments
Post Details
Added on Jun 26 2019
17 comments
2,243 views