Skip to Content
Author's profile photo Former Member

DB2 to HANA Migration -DB2 Translate () function achivement in SAP HANA

DB2 to SAP HANA Migration -Db2 Translate ()  function in SAP HANA


DB2 Query  :

select PHONE_NUMBER,

(TRANSLATE(PHONE_NUMBER,,‘1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz()-/’)) as PHNE

from  “Phone_test


In above query where ever its find any letter from  this string ‘1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz()-/’ in phone number  It replace with Space like ‘ ‘


result s(Out put) :


Db2 Image.PNG

In SAP HANA there is no  Translate function  or similar function is not available , There is a work around using Regular Expression for similar scenario.

SAP HANA Query  with out put:

HANA Image.png

Thanks,

Asif

Assigned tags

      2 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Satish Jhariya
      Satish Jhariya

      That's helpful, thanks Asif for sharing.

      Regards,

      Satish Kumar

      Author's profile photo Former Member
      Former Member

      Helpful one, Thanks for sharing