Regular expression to convert alphanumeric field into numeric field


/ Published in: SQL
Save to your folder(s)

This will take the alpha numeric loan number field and converts it into numeric loan number. If there are any loan numbers with alphabet then it is converted as NULL (basically alpha numeric loan numbers are ignored)


Copy this code and paste it in your HTML
  1. CASE
  2. WHEN REGEXP_LIKE(MASTER.LOANNO,'[^[:digit:]]') THEN NULL
  3. ELSE
  4. TO_NUMBER(MASTER.LOANNO)
  5. END AS ACCT_NBR,

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.