Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

refrential integrity 1

Status
Not open for further replies.

sydev

Programmer
Jun 8, 2004
3
US
hi all

i need help in checking refrential integrity between 2 tables. I am using 5.2 versions, so many of the stages are unavailable.
any kind of info or help is appreciated.

thank you
-sy
 
The standard approach is to read your source table as an input stream and do a referential integrity check in a transformer using a lookup or reference stage.

A lookup source can be a database table or it can be a hash file. Hash files tend to be the fastest type of lookup in DataStage so your job will run faster if you can dump your lookup fields into a hash file first, only export those fields you need.

Within the transformer you lookup the hash file based on your foreign key field. You can add a constraint to reject those rows without a lookup match, you can add an output link to save the rejected rows to a file or table, you can output an error message field with each row indicating what the problem was. There are lots of error handling options.
 
hi
thank you so much for the help.
really appreciate it. will try all the combinations you gave. coz the error output of the refrential integrity check needs to be sent to another sequential file which should also generate the error details.

thanx again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top