Re: replace single char for string using regexp_replace

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: replace single char for string using regexp_replace
Дата
Msg-id 4204.1577681403@sss.pgh.pa.us
обсуждение исходный текст
Ответ на replace single char for string using regexp_replace  (PegoraroF10 <marcos@f10.com.br>)
Список pgsql-general
PegoraroF10 <marcos@f10.com.br> writes:
> I have to replace ; , " and ' chars in an string putting its correspondent
> ascii value
> I have a
> Replace(Replace(Replace(Replace($$Text,with;On'It"$$,',','chr(59)'),';','chr(44)'),'"','chr(34)'),'''','chr(39)')
> It works but I would like to call just one Replace.

Use translate(), perhaps?

https://www.postgresql.org/docs/current/functions-string.html

            regards, tom lane



В списке pgsql-general по дате отправления:

Предыдущее
От: PegoraroF10
Дата:
Сообщение: replace single char for string using regexp_replace
Следующее
От: Matthias Apitz
Дата:
Сообщение: Re: testing in ESQL/C if a CUSROR "foo" is open?