Page 1 of 1

HASH FILE LOOKUPS

Posted: Mon May 24, 2004 5:08 pm
by ririr
Guys

Here is another situation. I have created a Hashfile lookup in one of my mappings.

In the source master query, the following are the columns:

OLDCOLA, OLDCOLB, OLDCOLC, NEWCOLA, NEWCOLB, NEWCOLC, I was able to manage the OLD AND NEW VALUES BY APPLYING TRIGGERS AT THE DATABASE LEVEL

OLDCOLA AND NEWCOLA are the KEYS.


THE HASHFILE IS JOINED WITH THE SOURCE MASTER QUERY TO LOAD THE CODE VALUE FROM HASH FILE LOOKUP INTO MASTER TARGET TABLE.

NOW, FOR LOADING THE HISTORY TABLE I AM USING THE OLDCOLA, OLDCOLB AND OLDCOLC VALUES TO POPULATE HISTORY RECORDS.

QUESTION ?

CAN I USE THE SAME HASFILE AND JOIN THE SOURCE NEWCOLA, OLDCOLA to get the CODE VALUE for OLD AND NEW.

I know it can be done if I have multiple instances of same hash file. But, is it possible to apply coditions in one hashfile and get old and new CODE VALUES.

Any feedback is appreciated!

Thanks

Posted: Mon May 24, 2004 9:30 pm
by ray.wurlod
You can probably do what you want. What is in the hashed file(s), and which column is the key column? What information do you want to return from the hashed file? Without knowing these things it is impossible to give you an answer.
Using a hashed file on a reference input link is almost the same as using any stage type, except that the only possible "join" is an equi-join on the hashed file key. If that key is not found, DataStage sets the value on every column to NULL (so it behaves like a left outer join; you can constraint the output of the Transformer stage so that keys found and keys not found can be directed to different output links, or discarded, thereby mimicking an inner join).