Reputation: 643
I have column with text where I need to change characters! For example
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) ;
Upvotes: 18
Views: 24121
Reputation: 44696
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
?
Upvotes: 14
Reputation: 1900
update tableT pp
set descript = (select replace(descript, '�', 'D') from tableT where id = pp.id)
Why don't use replace?
Upvotes: 20