how to update a table using active ,inactive flag
560497Feb 11 2007 — edited Feb 12 2007can anybody help me to write a plsql procedure for the following:
I have a table dept1 with records as follows:
deptno deptname
10 EDP
40 MKT
I want to update the above table(dept1) by inserting the new records , updating the old records and making the record which is in dept1 and not in dept2 as inactive and others as active using the records in a table dept2 .
The records in the dept2 :
deptno deptname
20 CRM
30 PRN
40 SALES
after update the table dept1 should be as follow:
deptno deptname status
10 EDP INACTIVE
20 CRM ACTIVE
30 PRN ACTIVE
40 SALES ACTIVE