stored procedure to compare two tables.
673809Apr 3 2009 — edited Apr 3 2009Hi,
I would like to compare these two tables using stored procedures.
dept1
SQL> select * from dept1;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
dept2:
SQL>select * from dept2;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 IT VIRGINIA
40 OPERATIONS BOSTON
I have
select * from dept1 minus select * from dept2
union all
select * from dept2 minus select * from dept1;
query but unable to convert that into stored procedure. I'm learning pl/sql and trying to compare these tables.
oracle 11, windows vista.
I wan to compare dept1 and dept2 using procedure, cursors and place the difference between two tables in log file.
any other method than minus query to compare tables?
Thanks,
kalyan
Edited by: user10676396 on Apr 3, 2009 12:27 PM