Monday, 2 September 2013

compare data between 2 table

compare data between 2 table

Hey i have a requirement to compare two tables of same structure. Table1
EmpNO - Pkey EmpName DeptName FatherName IssueDate ValidDate ..
I need to pass the EMPNO as parameter and i need to compare whether any of
the column get changes? and return YES OR NO value.
can i able to do that using a PL/SQL Funcation ? i was thinking of using
the CONCAT inbuild function to do that. im trying the below one
Table1Concat = Select CONCAT(Column1.....6) from tbale1 where emp_no=
in_empno;
Table2Concat = Select CONCAT(Column1.....6) from tbale2 where emp_no=
in_empno;
IF(Table1Concat<>Table2Concat ) THENreturn data_changed :='YES';
else data_changed :='NO';
END;

No comments:

Post a Comment