top of page

Get Only Numbers from a String in PLSQL

  • Writer: Rumesh Aponso (RMAX)
    Rumesh Aponso (RMAX)
  • Nov 22, 2024
  • 1 min read

Example 1:

SELECT  REGEXP_REPLACE(TRIM(REGEXP_SUBSTR('print document 2000, document 1000', '[^,]+', 1, LEVEL)), '[^[:digit:]]', '') str
FROM    DUAL
CONNECT BY INSTR('print document 2000, document 1000', ',', 1, LEVEL - 1) > 0;
ree

Example 2:

SELECT REGEXP_REPLACE('print document 2000, document 1000', '[^[:digit:]]', '') FROM DUAL;
ree

Comments


Copyright © 2025 RMAXOneNote

  • Online CV
  • LinkedIn
  • Youtube
  • GitHub
  • Blogger
bottom of page