18

I have column with text where I need to change characters! For example

  • �ay----> need to be Day
  • �rag---->need to be Drag

So I need to replace � with character D. I try next but I get error:invalid regular expression: quantifier operand invalid

update  tableT pp set descript=(select regexp_replace(descript,'�', 'D') 
FROM 
  tableT kk where pp.id=kk.id) ;

2 Answers 2

20
update tableT pp
set descript = (select replace(descript, '�', 'D') from tableT where id = pp.id)

Why don't use replace?

Sign up to request clarification or add additional context in comments.

Comments

14

It's just a plain UPDATE:

update  tableT set descript= regexp_replace(descript,'�', 'D')

add where descript like '%�%' to minimize transaction.

Or, as President Camacho says, why not use replace instead of regexp_replace?

1 Comment

plus 1 on the added WHERE

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.