Page 1 of 1

Target stage oracle

Posted: Thu Jul 16, 2015 6:03 pm
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%.

Posted: Thu Jul 16, 2015 6:56 pm
by rkashyap
Try

Code: Select all

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

Posted: Thu Jul 16, 2015 9:39 pm
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||'%'''

Posted: Fri Jul 17, 2015 10:41 am
by rkashyap
On DataStage 9.12, LIKE '%'||:SKU_ID||'%' works ok.

Posted: Fri Jul 17, 2015 11:24 am
by chulett
Interesting... thanks for checking. Seems to me that DataStage must be supplying the wrapper quotes otherwise Oracle would be barfing.