Scott
Scott

Reputation: 49

i got a name field which got some special characters like . ,.I want to remove them

I used reg_extract(field,'[A-Za-z0-9]','') function.It worked but i'm not getting my output. Example if i have a name field has names like this

XXXXX, Yyycc 

(both upper and lower cases). So i used a variable port to change it to upper and then i applied reg_extract. I'm getting only the first part of the name like

XXXXX.

If i got a name like this

(abcd,bce) 

then my output is abcdc.I don't know why it skipped the other part of the name.I also tried replacechr but i'm getting the same output.

Upvotes: 0

Views: 1678

Answers (2)

AnjiReddy KasiReddy
AnjiReddy KasiReddy

Reputation: 11

Please use this function it will work.

REG_REPLACE(field,'[^A-Za-z0-9]' ,'')

I am using the same function it's working for me.

Upvotes: 0

Bharathi Kannan
Bharathi Kannan

Reputation: 61

Edited:

Use this to remove special characters in a String:

REPLACECHR (0, INPUT, REPLACECHR ( 0, INPUT, 'abcdefghijklmnopqrstuvwxyz1234567890 ', '' ), '')

And REG_EXTRACT is used to extract one of the matching pattern form a regular expression. By default it will extract the first pattern.

Upvotes: 1

Related Questions