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!

how to update a table using active ,inactive flag

560497Feb 11 2007 — edited Feb 12 2007
can 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 12 2007
Added on Feb 11 2007
6 comments
1,660 views