lookup 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
pjangiti
Premium Member
Premium Member
Posts: 9
Joined: Wed Apr 09, 2008 5:57 am
Location: Hyderabad

lookup condition

Post by pjangiti »

Hi all,

First of all thank u for this wonderful platform.

I have a querry.


I am using a transformer to lookup a column from odbc stage.
I have a coumn EFFDT in the input data to the transformer , STARTDATE in lookup odbc and
the condition for lookup EFFDT<STARTDATE.
How can i implement this condition in the keyexpression of refernce link.
please help me out in resolving this issue.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Welcome. :D

Your Key Expression would simply be the column EFFDT so that it is passed to the ODBC lookup, everything critical is setup there. I'd suggest you first let the ODBC stage generate the SQL so you can see the syntax and then modify it. It will produce SQL for an equi-join and you'll need to edit it for the "<" part.

Lastly, if this needs to return multiple rows, you'll need to enable the 'Multiple Row Result Set' option on the reference link itself, otherwise all you'll get is one record returned no matter how many the SQL selects.
-craig

"You can never have too many knives" -- Logan Nine Fingers
pjangiti
Premium Member
Premium Member
Posts: 9
Joined: Wed Apr 09, 2008 5:57 am
Location: Hyderabad

Post by pjangiti »

[quote="chulett"]Welcome. :D

Your [b]Key Expression[/b] would simply be the column EFFDT so that it is passed to the ODBC lookup, everything critical is setup there. I'd suggest you first let the ODBC stage generate the SQL so you can see the syntax and then modify it. It will produce SQL for an equi-join and you'll need to edit it for the "<" part.

Lastly, if this needs to return multiple rows, you'll need to enable the 'Multiple Row Result Set' option on the reference link itself, otherwise all you'll get is one record returned no matter how many the SQL selects.[/quote]

Hi Chullet,
Thanks a lot.
If iam right i should change the condition( replace STARTDATE=? with STARTDATE>? ) in SQL for reference inputs section in the ODBC stage.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or "? < STARTDATE". As posted, you'd need "STARTDATE >= ?" I assume.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply