Toad World® Forums

how do i extract multiple characters from a string

Hi,

I am new to using data point and I have version 3.6

I am trying to extract multiple characters from a string for example:

SELECT XXXX(‘8!@#$%^&()5613?.?/’, '!@#$%^&()_+={}?>?/<>’ ) should give me 85613.

or

SELECT XXXX(‘P7889A’, ‘PA’) should give me 7889

would anyone know what snippet XXXX would be?

Thank you

Different databases provide different function to extract substring. For example, in Oracle you could use REGEXP_SUBSTR.

What database do you connect to?

Regards

Aleksey

You can try:

, REGEXP_REPLACE(YOUR_FIELD_NAME_HERE,’[^0-9’’]’,’’) ONLY_NUMBERS