I have a scenario were i need to lookup a date value on the input stream against a reference oracle table.
Each reference table row contains a start and end date value and i need to lookup the row where the input date value falls between the start and end date values on the reference table row.
what is the most efficient range lookup method to meet the above requirement?
Range Lookups V7.5.2
Moderators: chulett, rschirm, roy
Range Lookups V7.5.2
Thanks
Nigel
Nigel
-
- Participant
- Posts: 247
- Joined: Mon Jan 22, 2007 11:33 pm
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I'm not sure this is correct. Write Range Map stage creates a range map to support Range partitioning, not Range lookup.
Range (or "between") lookups are available in version 8. ABout the only way I know to do it in version 7 is to use a sparse lookup with user-defined SQL containing an appropriate BETWEEN clause.
Range (or "between") lookups are available in version 8. ABout the only way I know to do it in version 7 is to use a sparse lookup with user-defined SQL containing an appropriate BETWEEN clause.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Hi Ray,
I am trying to implement what you have suggested but was wondering how to reference a column on the input link in the user defined SQL as 0ne of the predicates. i.e.
SELECT RATE_STERLING
from CURRENCY_RATES_DIM
where FINANCIAL_DATE >= CURRENCY_RATES_DIM.START_DATE
and FINANCIAL_DATE <= CURRENCY_RATES_DIM.END_DATE
In the example above, FINANCIAL_DATE is a column on the input link.
I am trying to implement what you have suggested but was wondering how to reference a column on the input link in the user defined SQL as 0ne of the predicates. i.e.
SELECT RATE_STERLING
from CURRENCY_RATES_DIM
where FINANCIAL_DATE >= CURRENCY_RATES_DIM.START_DATE
and FINANCIAL_DATE <= CURRENCY_RATES_DIM.END_DATE
In the example above, FINANCIAL_DATE is a column on the input link.
Thanks
Nigel
Nigel
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You need a parameter marker or reference to the ORCHESTRATE structure, not the column name. For example one of the following.
Code: Select all
SELECT RATE_STERLING
from CURRENCY_RATES_DIM
where ? >= CURRENCY_RATES_DIM.START_DATE
and ? <= CURRENCY_RATES_DIM.END_DATE
Code: Select all
SELECT RATE_STERLING
from CURRENCY_RATES_DIM
where ORCHESTRATE.FINANCIAL_DATE >= CURRENCY_RATES_DIM.START_DATE
and ORCHESTRATE.FINANCIAL_DATE <= CURRENCY_RATES_DIM.END_DATE
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.