Hash table lookup with boolean condition

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
ekareem
Participant
Posts: 17
Joined: Wed Aug 27, 2003 7:10 pm

Hash table lookup with boolean condition

Post by ekareem »

I have a hash table that has a composite key (the key is composed of 2 columns c1 and c2)

I want to specify a lookup conidtion like this:

C1 = value1 and (C2=Value3 or Value4)

The first part is trivial.

The part 'and (C2=Value3 or Value4)' is where I have a problem

I assume that the logical operator 'and' goes by default, when I specify
C2=Value3 or C2=Value4 I get no syntax error but the row is not found even though it exists.

Any suggestions? Thanks.

ekareem
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post by loveojha2 »

I suppose you have specified like
'Value3' or 'Value4'
in the lookup condition for column 2.
Actually it is a logical condition which results into true (1) or false(0).
What is actually happening is like its trying to match
Col2 with either 0 or 1 (which you don't want).

For your case you would need two separate lookups.
In first you will specify
C1='Value1'
C2='Value3'
In the second you will specify
C1='Value1'
C2='Value4'

Hope this will help you. :)
ekareem
Participant
Posts: 17
Joined: Wed Aug 27, 2003 7:10 pm

Post by ekareem »

Great - Thanks
Post Reply