Searching for %Value% in a lookup table
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 20
- Joined: Sat Aug 09, 2008 1:53 pm
Searching for %Value% in a lookup table
Hello,
I have a requirement to implement the following logic.
if column A from table A is like '%columnB%' from table B return target value from B
Here A is the primary table, B is the reference / lookup table.
This means that if column A from table A has the value 'AMBC' and column B from table B has some value 'MB', it matches and an output record is returned.
Table B is having some 20 total records.
Could you help me with implementing this logic in Datastage?
I have a requirement to implement the following logic.
if column A from table A is like '%columnB%' from table B return target value from B
Here A is the primary table, B is the reference / lookup table.
This means that if column A from table A has the value 'AMBC' and column B from table B has some value 'MB', it matches and an output record is returned.
Table B is having some 20 total records.
Could you help me with implementing this logic in Datastage?
-
- Participant
- Posts: 251
- Joined: Mon Jun 09, 2008 5:52 am
-
- Participant
- Posts: 20
- Joined: Sat Aug 09, 2008 1:53 pm
Thanks for the reply. But I solved it another way.
I inserted the values in table B by enclosing the column B values within the wildcard characters '%' . For example, instead of inserting 'MB', I inserted '%MB%' and then wrote the following SQL Query
Select * from A, B where A.A like B.B
I guess this is more of a SQL solution than Datastage but this is what worked.
I inserted the values in table B by enclosing the column B values within the wildcard characters '%' . For example, instead of inserting 'MB', I inserted '%MB%' and then wrote the following SQL Query
Select * from A, B where A.A like B.B
I guess this is more of a SQL solution than Datastage but this is what worked.
in_finity307 wrote:Thanks for the reply. But I solved it another way.
I inserted the values in table B by enclosing the column B values within the wildcard characters '%' . For example, instead of inserting 'MB', I inserted '%MB%' and then wrote the following SQL Query
Select * from A, B where A.A like B.B
I guess this is more of a SQL solution than Datastage but this is what worked.
Does that mean that you have used sparse lookup instead of normal lookup ? please advice because i have the same issue and i cant use sparse lookup because the base is huge and the lookup table doesn't has indexes , also the lookup table is teradata table which isn't support sparse lookups
i'm waiting your feedback
Mohmmed Elgendy
Senior System Analyst
Data IntegrationTeam
Etisalat Egypt
+20 1118511161
Senior System Analyst
Data IntegrationTeam
Etisalat Egypt
+20 1118511161
-
- Premium Member
- Posts: 46
- Joined: Wed Jun 06, 2007 10:32 am
-
- Participant
- Posts: 20
- Joined: Sat Aug 09, 2008 1:53 pm
-
- Premium Member
- Posts: 46
- Joined: Wed Jun 06, 2007 10:32 am