compare records between parent and child table



IBM's Command List programming language & Restructured Extended Executor

compare records between parent and child table

Postby kuldeep negi » Tue May 26, 2009 5:00 pm

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.
kuldeep negi
 
Posts: 21
Joined: Mon Apr 27, 2009 3:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: compare records between parent and child table

Postby dick scherrer » Tue May 26, 2009 11:41 pm

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: compare records between parent and child table

Postby kuldeep negi » Wed May 27, 2009 12:30 pm

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"
kuldeep negi
 
Posts: 21
Joined: Mon Apr 27, 2009 3:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: compare records between parent and child table

Postby dick scherrer » Thu May 28, 2009 12:43 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post