Target stage oracle

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
karry450
Participant
Posts: 201
Joined: Wed Nov 14, 2007 11:31 pm
Location: HYD

Target stage oracle

Post by karry450 »

Hi Team,

I am updating bunch of records in the target but I want to use my own sql to update records using LIKE operator.

Can any one help with the syntax.
SKU_ID is the key and the below syntax doesnt work if I give in the target stage connector/enterprise stage.


UPDATE SKU SET SECONDARY_DESC=:SECONDARY_DESC,COLOR=:COLOR WHERE SKU_ID LIKE:SKU_ID%.
rkashyap
Premium Member
Premium Member
Posts: 532
Joined: Fri Dec 02, 2011 12:02 pm
Location: Richmond VA

Post by rkashyap »

Try

Code: Select all

UPDATE SKU SET SECONDARY_DESC=:SECONDARY_DESC,COLOR=:COLOR WHERE SKU_ID LIKE '%'||:SKU_ID||'%'
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Is this actually a Server job question as marked?

You'll need the SKU_ID enclosed by percent signs and single quotes for the LIKE operator, so probably more like this. Have no way to test it, however.

Code: Select all

UPDATE SKU SET SECONDARY_DESC=:SECONDARY_DESC,COLOR=:COLOR WHERE SKU_ID LIKE '''%'||:SKU_ID||'%'''
-craig

"You can never have too many knives" -- Logan Nine Fingers
rkashyap
Premium Member
Premium Member
Posts: 532
Joined: Fri Dec 02, 2011 12:02 pm
Location: Richmond VA

Post by rkashyap »

On DataStage 9.12, LIKE '%'||:SKU_ID||'%' works ok.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Interesting... thanks for checking. Seems to me that DataStage must be supplying the wrapper quotes otherwise Oracle would be barfing.
-craig

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