Sparse lookup with like option not working

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
RAJEEV KATTA
Participant
Posts: 103
Joined: Wed Jul 06, 2005 12:29 am

Sparse lookup with like option not working

Post by RAJEEV KATTA »

oracle Sparse lookup with like option is not working,do we have any alternative method to do the below operation.

Here is an exmaple below

SELECT
PATIENT.FIRST_NAME
FROM
PATIENT PATIENT
WHERE
PATIENT.FIRST_NAME LIKE 'ORCHESTRATE.FIRSTNAME%'

the input FIRTSNAME is coming from a row generator.The datatype is varchar(15) for both the oracle database table & row generator.Even though there is a matching record its rejecting the record.The value in the database table is 'CHARLENE' & the value in row generator is 'CHARLE'.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:idea: When you don't get any answers, best to just reply to your original post to 'bump' it back up into the limelight rather than post the exact same question again.
-craig

"You can never have too many knives" -- Logan Nine Fingers
RAJEEV KATTA
Participant
Posts: 103
Joined: Wed Jul 06, 2005 12:29 am

Post by RAJEEV KATTA »

It got resolved and here is the solution

trim(a.FIRST_NAME) like trim(ORCHESTRATE.FIRST_NAME) || '%'
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That makes sense. Your original syntax made everything in the quotes a literal so it was looking for the literal string "'ORCHESTRATE.FIRSTNAME%" (including the percent sign) and not resolving the field reference or seeing the wildcard.
-craig

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