cancel
Showing results for 
Search instead for 
Did you mean: 

Need help in using search_replace function against persistent cache datastore

0 Kudos

Hi ,

I am trying to do search_replace in one of my transformation and i am getting the below error:

A NULL replace value is specified in the function <search_replace>. NULL replace value is not allowed for Word and Substring

Sample values from my table are :

SRCH_VAL             REPLACE_VAL   

-------------------                 --------------

@NOEMAIL.                  NULL        

@NO_EMAIL.                NULL 

@NO-EMAIL.                 NULL       

i NEED TO replace with null for some of the banned key words in email address.

i was trying to do with Search_replace and it is throwing above error.

Please blow some light to fix these error

i tried to give physical table from DB2 and it is also giving the same error.

Thanks,

Sreenivas

Accepted Solutions (1)

Accepted Solutions (1)

former_member187605
Active Contributor
0 Kudos

If you put a 'Null' string instead of a null value in your table, you can use

     decode(search_replace(SRCH_VAL) = 'Null', null, SRCH_VAL)

0 Kudos

Thanks Dirk .. your trick worked for me

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Sreenivas ,

You can use a ifthenelse function also

ifthenelse ( searchstr = '@NOEMAIL' or '@NO_EMAIL' OR '@NO-EMAIL' , NULL , searchstr ).

try this one, hope it will work

Thanks,

Sravan.

0 Kudos

i can't use if then else as my values are configured in DB2