Page 1 of 1

compare records between parent and child table

PostPosted: Tue May 26, 2009 5:00 pm
by kuldeep negi
i want to compare the records in the parent table and the child table and to find out the uncommon record between them.

i have a SQL query for this ,but every time i have to change it manually depending upon the foreign key relation(constraint).

Please suggest if it can be done using rexx in a more simpler way.

Re: compare records between parent and child table

PostPosted: Tue May 26, 2009 11:41 pm
by dick scherrer
Hello,

How might rexx make anything "simpler"?

Sounds like this could be a simple SPUFI.

What is an "uncommon record"? If there is some process that corrupts data, the process needs to be fixed rather than streamlineing some process to identify the corruption.

Possibly i misunderstand.

Re: compare records between parent and child table

PostPosted: Wed May 27, 2009 12:30 pm
by kuldeep negi
As the data in the tables is very dynamic so there is data discrepancy most of the time between the parent and the child table.

uncommon record: any record which is present in the child table but not present in the parent table.

so what i am looking for is the piece of code in rexx which would compare the records in the parent and the child table depending upon the foreign key relationship between them. Finally to come up with the" uncommon record". it would be more user friendly if we take following input from the user : parent table, child table and foreign keyrelationship and then return the uncommon record as the output so that it can be inserted in the parent table.

i am having access to insert the values in the tables.

Please suggest...




"The truth shall set u free"

Re: compare records between parent and child table

PostPosted: Thu May 28, 2009 12:43 am
by dick scherrer
Hello,

As the data in the tables is very dynamic so there is data discrepancy most of the time between the parent and the child table.
Sorry, but this is nonsense. . . :!: Some of the systems i've supported do millions of transactions an hour and there is never an out-of-sync.

If the data is/gets out of sync, it is just a poor implementation and needs to be fixed - not detected later. There is no good reason to have the data out-of-sync.

If you want the process to be user-friendly, you need to fix the process so that it does not corrupt the user's data.

You may find some way to use rexx, but your time would be better spent preventing the problem.