[英]How to extract specific values in a string in informatica
我需要從輸入字段電話號碼中提取(
, )
, -
和從 0 到 9 的數字。
例如,對於輸入數據: (891)456-567A$rT67
Output 應該是(891)456-56767
可以通過以下2個步驟完成 -
v_ph_no = REG_REPLACE( in_ph_no,'[^0-9]','')` -- variable port that will replace everything but 0 to 9.
out_ph_no = '(' || substr(v_ph_no,1,3)||')' || substr (v_ph_no,4,3)||'-' || substr (v_ph_no,6) -- o/p port that will create ph no in desired format.
說明 - 首先刪除所有不需要的字符,然后將其格式化為所需的電話無格式。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.