Search Postgresql Archives

Re: replace single char for string using regexp_replace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



PegoraroF10 <marcos@xxxxxxxxxx> 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






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux