I am using in-memory H2 for unit testing where as prod env is running on 
DB2. I have a requirement to remove non-alphanumeric characters @. from a 
field. I used REPLACE(TRANSLATE(BE.PARTY2_FIELD,'@.',' '), ' ','') which is 
working in in unit testing using H2 but failing when running in actual env 
which uses DB2. I see the reason is TRANSLATE function syntax in H2 and DB2 
are different.


*H2* - TRANSLATE ( value , searchString , replacementString)

*DB2* - TRANSLATE ( value , replacementString, searchString)


Is there any solution to it which can work in both H2 and DB2?


*Query:*


select distinct bre.ref, bre.name, 

    bre.repository,

    bre.party_decision, 

    bre.PARTY1_ID_VALUE as party1, 

    REPLACE(TRANSLATE(bre.PARTY2_ID_VALUE,'!@#$%^&*()-=+/''"\{}[];:.,<>?_', 
'                              '), ' ', '') as party2 

from tripodsdr.business_retention_eligibility bre

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to