Hash Lookup Multiple values

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
snassimr
Premium Member
Premium Member
Posts: 281
Joined: Tue May 17, 2005 5:27 am

Hash Lookup Multiple values

Post by snassimr »

Hi !

?I need some help

How I can to arrange lookup for some values .

For example ,

I need to check if any rows with id =1 and type = 5 or 6 within hash file with keys id and type
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post by I_Server_Whale »

Please frame your question properly. This is NOT an Alladin's lamp.

Thanks!
Naveen.
poorna_76
Charter Member
Charter Member
Posts: 190
Joined: Thu Jul 08, 2004 10:42 am

Re: Hash Lookup Multiple values

Post by poorna_76 »

snassimr wrote:Hi !

?I need some help

How I can to arrange lookup for some values .

For example ,

I need to check if any rows with id =1 and type = 5 or 6 within hash file with keys id and type

Specify your keys for the LookUp.

In the Transformer you need to check
"Returns Multiple Row Set" option for the lookup (link).

When Multiple rows are returned for a particular record, code your condition(if type = 5 or 6), you will be able to write out the record you are interested in.
kollurianu
Premium Member
Premium Member
Posts: 614
Joined: Fri Feb 06, 2004 3:59 pm

Post by kollurianu »

Hi Poorna,

How would you give the option in the transformer , i mean where is the option seen .

Appreciate your time and thanks for your help in advance.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Hashed files do not natively support 'Multiple row result sets'.

kollurianu - it's a Link property. Get to it by right-clicking on the lookup stage from inside the Transformer.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kollurianu
Premium Member
Premium Member
Posts: 614
Joined: Fri Feb 06, 2004 3:59 pm

Post by kollurianu »

Hi Chullet,

Hey i didnot find the option in the transformer that is linked with the
hash file , can you please tell me where it is exactly found,


Hashed files do not natively support 'Multiple row result sets'.

kollurianu - it's a Link property. Get to it by right-clicking on the lookup stage from inside the Transformer.

what did you mean by when you said that hash files do 'not' natively
support 'Multiple row result sets' ?

can we use the above feature or not advisable.

Thanks a bunch,
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You won't as it is not a valid option for a hashed file - you'll only find that option there when the link is to a UV stage or an ODBC stage.

I'm not going into the gory details as they been posted here ad nauseum, but you can point a UV stage to an existing Hashed file and then you can get the hashed file to return multiple rows per lookup. But you need to do several things to set that up properly or it either won't work or it will work very very slowly.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Two choices.

1. Lookup on the key and test the returned non-key value within stage variables.

2. Create your hashed file with more than one key column, and perform multiple lookups.

Option 1 is the more efficient.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kollurianu
Premium Member
Premium Member
Posts: 614
Joined: Fri Feb 06, 2004 3:59 pm

Post by kollurianu »

Hi All,

Thank you very much Ray and Chulet for your answers,



But how implement second option Ray, would please suggest me.


[/quote]Create your hashed file with more than one key column, and perform multiple lookups.

Thank you all lot
Post Reply